Fix --thinking flag and add exclude_dynamic_sections#18
Merged
Conversation
…tions Port two fixes from Python SDK PRs #796 and #797: - Use --thinking adaptive/disabled instead of --max-thinking-tokens for non-budget thinking modes, matching the CLI's dedicated flag - Add exclude_dynamic_sections to SystemPromptPreset for cross-user prompt caching, forwarded via initialize control message Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
|
@claude review this PR |
The || operator treats false as falsy, so eds = hash[:key] || hash['key'] would skip a false value from symbol keys. Use fetch with block instead. Add Client specs covering SystemPromptPreset, Hash, false value, and plain string paths for exclude_dynamic_sections extraction. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CHANGELOG: add 0.14.1 entry for thinking fix and exclude_dynamic_sections - README: fix thinking descriptions, add cross-user prompt caching section - Skills references: update system_prompt and thinking docs in both copies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Ports two fixes from the Python Claude Agent SDK:
anthropics/claude-agent-sdk-python#796 — Fix
--thinkingflag for adaptive/disabled modes. Previously,ThinkingConfigAdaptivemapped to--max-thinking-tokens 32000andThinkingConfigDisabledto--max-thinking-tokens 0, which put the CLI into fixed-budget mode. Now uses--thinking adaptive/--thinking disabledto activate the correct CLI code paths. OnlyThinkingConfigEnableduses--max-thinking-tokens.anthropics/claude-agent-sdk-python#797 — Add
exclude_dynamic_sectionstoSystemPromptPreset. When set, the CLI strips per-user dynamic sections (cwd, auto-memory, git status) from the preset system prompt and re-injects them into the first user message, making the system prompt byte-identical across users for prompt-caching hits. Forwarded viaexcludeDynamicSectionsin the initialize control message.anthropics/claude-agent-sdk-python#785 — Add
autotoPermissionMode— already present in Ruby SDK, no changes needed.Test plan
--thinking adaptive,--thinking disabled, mutual exclusivity with--max-thinking-tokensexclude_dynamic_sectionsstorage and serialization🤖 Generated with Claude Code