-
Notifications
You must be signed in to change notification settings - Fork 338
[Bug] "Prompt is too long" at ~254K tokens despite Claude Code supporting 1M context #384
Description
Environment
- OS: Windows 11 Pro
- cc-connect: v1.2.2-beta.4 (npm beta)
- Agent: claudecode
- Platform: feishu (WebSocket)
- Claude Code: latest, with 1M context window enabled
Problem
When using cc-connect with Claude Code via Feishu, the session hits "prompt is too long" error at approximately 254K tokens. However, my Claude Code CLI supports 1M context window natively.
Expected Behavior
cc-connect should utilize the full 1M context window available to Claude Code, or at least handle context limits more gracefully (e.g., auto-compress before hitting the limit).
Actual Behavior
The session fails with "prompt is too long" well before reaching the 1M context limit. The error forces me to manually run /new to start a fresh session.
Analysis
Looking at the source code (agent/claudecode/session.go), cc-connect spawns Claude Code with:
args := []string{
"--output-format", "stream-json",
"--input-format", "stream-json",
"--permission-prompt-tool", "stdio",
}No context window or token limit flags are passed. PR #137 added fallback behavior (auto-recover to fresh session on "prompt is too long"), but the root cause — why the limit is hit at ~254K instead of 1M — is not addressed.
Questions
- Is there an internal limit in cc-connect that caps context below Claude Code's native 1M?
- Should cc-connect pass
--max-context-tokensor similar flag to Claude Code CLI? - Could the
[auto_compress]config section help here? If so, what's the recommended configuration?
Config
[[projects]]
name = "feishu-workspace"
[projects.agent]
type = "claudecode"
[projects.agent.options]
work_dir = "C:\\Users\\zy"
mode = "default"
[[projects.platforms]]
type = "feishu"
[projects.heartbeat]
[projects.auto_compress]Workaround
Currently using /new to start fresh sessions when context fills up.