30 Commits
Author SHA1 Message Date
Claude 2da132b6c8 fix(cursor): revert sandbox flag, document shell restriction in default mode
The --sandbox flag requires kernel v6.2+ and is unavailable on most
headless servers. The actual issue users hit ("only ls allowed") is
the Shell tool command allowlist in --trust (default) mode, which is
resolved by switching to mode = "force" (--force).

Reverts the sandbox config option; updates config.example.toml to
clearly document that default mode restricts shell to safe commands.

Made-with: Cursor
2026-04-01 10:47:32 +08:00
Claude 6152854fa0 feat(cursor): add sandbox option to disable restricted tool mode
Cursor Agent CLI defaults to sandbox mode in headless environments,
limiting available tools to read-only operations (ls, etc.). Add a
configurable `sandbox` option ("enabled"/"disabled"/"") that maps to
the `--sandbox` CLI flag, allowing users to unlock full tool access
(shell, edit, write) when running via cc-connect.

Config example:
  [projects.agent.options]
  sandbox = "disabled"

Made-with: Cursor
2026-04-01 09:59:22 +08:00
quabugandClaude Opus 4.6 71a2f9b284 fix: ignore ContinueSession sentinel in non-Claude agents
* fix: ignore ContinueSession sentinel in non-Claude agents

The ContinueSession ("__continue__") sentinel was introduced in df5cc64
for the --continue bridge, but only the claudecode agent was updated to
handle it. All other agents (pi, gemini, codex, cursor, qoder, opencode,
iflow) stored the literal "__continue__" as their session/resume ID,
causing CLI failures like `No session found matching '__continue__'` and
persistent "(empty response)" replies.

The fix adds a `resumeID != core.ContinueSession` guard to each agent's
session constructor so the sentinel is treated as "" (fresh session).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(codex): remove --cd from exec resume args

The codex CLI's `exec resume` subcommand does not support --cd, causing
"unexpected argument '--cd'" errors on every resumed session. The process
working directory is already set via cmd.Dir, so --cd is unnecessary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 10:21:11 +08:00
Claude ec446f4786 test: improve core coverage and fix flaky cursor test
- core/engine_test.go: Add tests for AddPlatform, GetAgent,
  ClearCommands, AddCommand, AddAlias, estimateTokens
- agent/cursor: Increase timeout from 5s to 30s for real CLI tests
  and add SKIP_REAL_AGENT_CLI env var for CI environments

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 00:17:40 +08:00
Deeka WongandDeeka Wong 9df8d494dd feat(core): align /model switching with provider flow (#246)
Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
2026-03-21 20:32:22 +08:00
Claude 2af2b3946b test(cursor): skip agent CLI test in CI environment
Skip agent CLI test when running in CI environment where no real cursor agent is available.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-19 22:50:24 +08:00
Claude e67020a041 test(cursor): increase timeout for flaky agent models test
The TestFetchModelsFromAgentCLI test was failing due to 2 second timeout
being too short for the agent CLI to respond. Increased to 5 seconds
to account for environment variability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 09:43:26 +08:00
Deeka WongandDeeka Wong 1123c83edb fix(core): share provider model lookup and stabilize tests (#210)
* fix(core): share provider model lookup and stabilize tests

* fix(tests): address PR review follow-ups

---------

Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
2026-03-19 07:55:48 +08:00
80ce4a5632 Add models list to provider config for per-provider model selection via alias (#200)
* Initial plan

* Add models parameter to provider config for /model command support

Co-authored-by: huangdijia <8337659+huangdijia@users.noreply.github.com>

* Change provider models config to alias+model table format with alias-based switching

Co-authored-by: huangdijia <8337659+huangdijia@users.noreply.github.com>

* Update README and docs with /model command and [[providers.models]] alias config format

Co-authored-by: huangdijia <8337659+huangdijia@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huangdijia <8337659+huangdijia@users.noreply.github.com>
2026-03-18 17:44:44 +08:00
Gaoyuan-SIAT f04c7c51cd feat: add /dir command for dynamic work directory switching 2026-03-16 12:08:41 +08:00
Shawn 588b22b223 fix(agent): always close events channel on session Close timeout (#163)
Six agent session adapters (codex, cursor, gemini, iflow, opencode,
qoder) only close the events channel when wg.Wait completes within
the 8-second timeout. If the timeout fires, the channel is left open,
which can cause consumers to block indefinitely waiting for channel
closure and prevents the engine from detecting that the session has
ended.

Move close(events) after the select block so the channel is always
closed regardless of whether the timeout fires, matching the pattern
already used by piSession.
2026-03-16 06:46:04 +08:00
kevinWangSheng be74fddca2 fix(agent): prevent panic from closing events channel while readLoop may still send
In 6 agent session implementations (codex, opencode, qoder, iflow, cursor,
gemini), Close() unconditionally calls close(events) after an 8-second
timeout, even when the readLoop goroutine may still be running and
sending events to the channel. Due to Go's select non-determinism, the
readLoop goroutine can choose the send case over the ctx.Done() case,
causing a "send on closed channel" panic.

Move close(events) into the case where wg.Wait() succeeds (readLoop has
fully exited), and skip closing on timeout to prevent the race. This
follows the same safe pattern already used by claudeSession, where the
events channel is only closed after the readLoop goroutine has finished.
2026-03-14 08:36:29 -07:00
chenhg5andClaude 645aaebd1c refactor(core): replace hardcoded agent checks with interface and improve platform-agnostic design
- Replace hardcoded agent binary checks with AgentDoctorInfo interface
- Remove platform-specific logic from help card rendering
- Rename MarkdownToTelegramHTML to MarkdownToSimpleHTML for broader use
- Clean up core engine code to avoid platform/agent name hardcoding
- Add CLIBinaryName and CLIDisplayName methods to agent implementations
- Consolidate help card rendering logic to be platform-agnostic

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-13 17:21:14 +08:00
zhuguanqiandClaude Opus 4.6 9be1b78295 feat: enable file attachment support for all agents
Extract SaveFilesToDisk/AppendFileRefs helpers into core package and
wire up file handling for Cursor, Codex, OpenCode, Qoder, and iFlow.
Files are saved to .cc-connect/attachments/ and paths are appended to
the prompt so each CLI can read them with its built-in tools.
Also refactors Claude Code to reuse the shared helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:16:55 +08:00
zhuguanqiandClaude Opus 4.6 f7cbc8c2d0 feat(feishu): add file message support
Add FileAttachment type and wire up file handling across the stack so
that files sent in Feishu are downloaded and forwarded to agents.
Claude Code saves files locally for tool-based reading; Gemini passes
them as temp file references. Other agents log a warning and ignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:16:55 +08:00
zxAgent fffc5847ea feat(cursor): implement AvailableModels function to fetch models from agent CLI and add fallback options 2026-03-13 01:19:26 +08:00
chenhg5andClaude 8818d3bed1 refactor(agent): optimize scanner buffer sizes
Updated buffer sizes for stdout scanners across all agent sessions:
- Initial buffer size reduced from 1MB to 64KB
- Max buffer size increased from 1MB to 10MB

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-12 06:34:02 +08:00
chenhg5andClaude 58f7b7068e feat(cursor): add interaction query handling and thinking buffer
Add support for handling interaction queries (webFetch/shell requests) and accumulate thinking deltas in a buffer before emitting completed events. Also adds WebFetch tool call type and debug logging.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-10 10:57:17 +08:00
chenhg5andClaude 0667e970bf feat(agent): add session deletion capability
Implement session deletion functionality across all agent implementations (claudecode, codex, cursor, gemini)
Add new /delete command with session lookup by ID/prefix
Add i18n support for delete-related messages
Update command help texts to include new delete command
Add SessionDeleter interface for agents supporting deletion
Implement core deletion logic with active session protection

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-05 13:53:43 +08:00
chenhg5andClaude 5e0a192b01 feat(claudecode): add provider proxy support for third-party endpoints
Add local reverse proxy support for third-party Claude providers with:
- Thinking parameter override rewriting
- Bearer token auth compatibility
- Provider clearing functionality
- Configurable thinking modes
- Improved provider management UX
- Enhanced markdown rendering for Feishu

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 23:57:13 +08:00
chenhg5andClaude f2920739d8 feat: add timeout handling for agent session closure
Added timeout mechanisms with logging for graceful session closure across multiple agent types (claudecode, codex, cursor, gemini, opencode, qoder). Modified engine cleanup to handle timeouts and improve logging. Sessions now timeout after 8-10 seconds with appropriate warnings/errors.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 22:02:54 +08:00
chenhg5andClaude e8e39413e8 refactor(session): add context-aware event sending and secure arg logging
Add context-aware select statements when sending events to prevent blocking on closed channels. Implement secure argument logging using RedactArgs to mask sensitive flags. Add atomic file writes and locks for config safety. Improve session handling with mutex protection and deduplication checks.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 12:38:37 +08:00
chenhg5andClaude 905287adb1 refactor: remove hardcoded 200-char truncation in tool input
Remove fixed 200-rune truncation from all agents since truncation
is now handled dynamically via /config (thinking_max_len, tool_max_len).

Affected agents: claudecode, codex, cursor, gemini, qoder

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 10:07:18 +08:00
chenhg5andClaude 7764465bc0 feat(cursor): improve session listing with message count and summary
- Add message count display for each session
- Use first user message as summary fallback instead of session ID
- Fix meta value reading (direct TEXT read, not hex() wrapped)
- Add RootBlobID tracking for message blob traversal
- Parse blob protobuf structure to count user/assistant messages

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 09:30:20 +08:00
chenhg5andClaude Opus 4.6 ca728fbe70 feat: add SkillProvider support for codex, cursor, qoder agents
Extend skill discovery to remaining agents:
- codex: .codex/skills + .claude/skills + CODEX_HOME/skills
- cursor: .claude/skills (project + home)
- qoder: .claude/skills (project + home)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 09:02:39 +08:00
chenhg5andClaude b229ea5801 feat(cc-connect): add --stdin support and improve message sending
- Added --stdin support for sending multi-line/special character messages via heredoc

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-03 18:03:59 +08:00
chenhg5andClaude 88e55674a5 feat(core): add context compression support
Implement context compression functionality across agents with `/compress` and `/compact` commands. Adds ContextCompressor interface, command handling in engine, and i18n messages. Supported agents implement CompressCommand() with their specific commands.

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-03 09:59:00 +08:00
chenhg5andClaude 9265d2bdff feat(agent): add model switching support with /model command
Add model selection capabilities across all agents with:
- ModelSwitcher interface for dynamic model switching
- `/model` command to list/change models
- Default model lists for each agent
- API-based model fetching with fallback
- Session-aware model persistence
- I18n support for model messages

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-02 19:36:27 +08:00
chenhg5andClaude c33f90cb34 feat(cron): add cron scheduling system with CLI and API support
generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-02 14:35:05 +08:00
chenhg5andClaude ed8778b99e feat(agent): add Cursor Agent integration with CLI support
Add full integration for Cursor Agent with support for CLI interactions via `agent --print --output-format stream-json`. Includes:
- New cursor package with Agent and Session implementations

generated by llmgit

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-01 19:28:41 +08:00