Repository navigation
Conversation
…Converse requests
|
Codex review: needs real behavior proof before merge. Reviewed June 27, 2026, 8:09 AM ET / 12:09 UTC. Summary PR surface: Source +21, Tests +135. Total +156 across 2 files. Reproducibility: yes. at source level: current main only sends Bedrock inferenceConfig.maxTokens from resolved options, and the Fable/adaptive branches do not derive that value from model.maxTokens while the non-adaptive Claude branch does. I did not run a live AWS Bedrock request in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused provider-runtime fix after redacted real Bedrock proof is added, or after a maintainer explicitly accepts source-level proof and the quota/cost behavior change. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main only sends Bedrock inferenceConfig.maxTokens from resolved options, and the Fable/adaptive branches do not derive that value from model.maxTokens while the non-adaptive Claude branch does. I did not run a live AWS Bedrock request in this read-only review. Is this the best way to solve the issue? Yes, this appears to be the best fix shape because it reuses the existing adjustMaxTokensForThinking helper in the Bedrock simple option resolver instead of adding a new config surface. The remaining blocker is real provider proof or maintainer acceptance of source-level evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c5d34c8376f8. Label changesLabel justifications:
Evidence reviewedPR surface: Source +21, Tests +135. Total +156 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
… and Fable 5 option resolution
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…ve and Fable 5 via streamSimpleBedrock
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
Fixes #97176 — Amazon Bedrock Claude models using adaptive thinking (Opus 4.8, Fable 5) are hard-capped at 4096 output tokens. At higher thinking levels the thinking block alone consumes the budget, causing
stop_reason: "length"before any answer or tool call is delivered.Why This Change Was Made
Root cause:
resolveSimpleBedrockOptionsinextensions/amazon-bedrock/stream.runtime.tsonly callsadjustMaxTokensForThinking()for the non-adaptive Claude branch. The Fable 5 branch (line 361) and adaptive-thinking branch (line 391) both returnbasewith reasoning/thinkingBudgets set but never derivemaxTokensfrommodel.maxTokens— leaving it at the 4096 default.Fix: Apply
adjustMaxTokensForThinking()in all three Claude branches somodel.maxTokensis consulted uniformly. When no explicit caller cap is set (base.maxTokensis undefined), the helper usesmodel.maxTokensdirectly; when a cap exists, it fits the thinking budget inside it.base.maxTokens(4096)adjusted.maxTokens(model cap)base.maxTokens(4096)adjusted.maxTokens(model cap)adjusted.maxTokens✓Evidence
Source-level reproduction (current
main)Non-adaptive Claude branch (lines 411-427) correctly calls
adjustMaxTokensForThinking()— this fix extends that same pattern.adjustMaxTokensForThinkingcontract (simple-options.ts:42-71):baseMaxTokens === undefined→ returnsmodelMaxTokensbaseMaxTokensset → returnsMath.min(baseMaxTokens + thinkingBudget, modelMaxTokens)After fix
Tests
Risk checklist
adjustMaxTokensForThinkinghelper (same as non-adaptive branch)options.maxTokensstill acts as a cap (helper preservesMath.min)Proof limitations
Live AWS Bedrock proof is not practical in this contributor PR. The fix is source-reproducible:
mainin the canonical issue reviewadjustMaxTokensForThinkingpattern worksinferenceConfig.maxTokens(verified in ClawSweeper review)Current review state
Ready for ClawSweeper review. Triple-stack labeling (queueable-fix, fix-shape-clear, source-repro) on the canonical issue.