Add MAX_THINKING_TOKENS env support and fix file-read-info format #226
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR for awareness and discussion.
claude-code-acp doesn't currently support configuring "maxThinkingTokens" (https://platform.claude.com/docs/en/agent-sdk/typescript) nor is it configured in the query. Result, at least for me, is that agent thinking chunks are never flowing through the chain. I added environment support to my ACP host, added env variable to query init for maxThinkingTokens following the pyton sdk env "MAX_THINKING_TOKENS". Result is now agent thinking chunks DO flow. And I can see Claude reason. Before, no chunks ever. This is perhaps based on configuration that Claude Agent SDK reads but could be made more flexibel. Such as this suggestions.
Fix file-read-info message: was showing nonsensical range format 'Read lines 160-40', now shows 'Read 40 lines starting at line 160'. The way this was written was confusing for myself and for Claude. If the file-read-info is supposed to give information, then lines like "Read lines 160-40" says absolutely nothing.
Reproduce:
Configure your ACP host to parse thinking tokens with no other external configuration. Claude will not send any.
Enable maxThinkingTokens in ACP and set it to something like 8096. Try your ACP implementation again, Claude now sends thinking chunks.
Bugs:
Anthropic has a meta issue. Don't talk about the "thinking" tag with Claude. It will break output regardless of what client you use. (even on Claude Code CLI)