-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
Summary
After hitting the Anthropic API token limit (200,000 tokens), the jcode tool enters an unusable state. None of the recovery mechanisms work, and the tool cannot be used in new sessions.
Environment
- Tool: jcode
- Anthropic API model: all of them
- OS: Ubuntu 24.04.4 LTS (WSL2)
- jcode version: jcode v0.3.3 (eaa8834)
Steps to Reproduce
- Run a very long task that accumulates over 200,000 tokens in context
- Tool hits Anthropic API error:
prompt is too long: 202,683 tokens > 200,000 maximum - Attempt to recover with
jcode --resume - Attempt to use
/compactcommand - Attempt to send new messages
- Start a fresh session/new conversation
- Try to use the tool in the new session
Expected Behavior
jcode --resumeshould gracefully handle the token limit by dropping old context or summarizing/compactshould reduce the context size and allow continued operation- A new session should work independently without inheriting the previous session's state
- The tool should provide guidance on how to recover
Actual Behavior
jcode --resumefails silently or with unclear error messages/compacthas no effect- New messages cannot be sent
- Fresh sessions are also affected (unable to use the tool)
- Tool remains completely unusable after hitting the limit
Error Message
✗ Anthropic API error (400 Bad Request): {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 202683 tokens > 200000 maximum"},"request_id":"req_011CYRsajgCLywGNopbWMARY"}
Additional Context
- The context limit was reached during a legitimate long-running task
- Even starting a completely new session doesn't resolve the issue
- No recovery mechanism appears to be functional
Suggested Fixes
- Implement context management that automatically summarizes or truncates old conversation history when approaching limits
- Add a
--clear-contextor--resetflag to completely clear state and start fresh - Make
/compactcommand actually reduce token usage by summarizing previous context - Improve error recovery so that hitting the limit doesn't permanently break the tool
- Provide better documentation on handling long-running tasks (task chunking, intermediate saves, etc.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels