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
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
* 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>
- 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>
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>
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>
* 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>
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.
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.
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
- Added --stdin support for sending multi-line/special character messages via heredoc
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>
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>
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>
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>