Repository navigation
fix: honor Bedrock adaptive max token caps - #97248
yungchentang wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 27, 2026, 9:06 AM ET / 13:06 UTC. Summary PR surface: Source +13, Tests +77. Total +90 across 2 files. Reproducibility: yes. source-reproducible: current main only sends Bedrock inferenceConfig.maxTokens from resolved options, and the Fable/adaptive branches do not derive that value from model.maxTokens. I did not run a live AWS Bedrock request in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model 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 one focused Bedrock runtime fix after redacted real Bedrock proof or explicit maintainer acceptance of the quota/cost behavior change. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main only sends Bedrock inferenceConfig.maxTokens from resolved options, and the Fable/adaptive branches do not derive that value from model.maxTokens. 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 is a narrow maintainable fix shape because it reuses the Bedrock provider's simple option resolver and avoids adding a new config surface. The remaining question is proof and maintainer acceptance of the larger default request cap. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c5d34c8376f8. Label changesLabel justifications:
Evidence reviewedPR surface: Source +13, Tests +77. Total +90 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
|
Closes #97176
AI-assisted with Codex.
What Problem This Solves
Fixes an issue where users running Bedrock Claude Fable or adaptive-thinking Claude models could have Converse requests capped at the core default 4096 output tokens when the resolved model metadata had a larger
maxTokenscap. At higher thinking effort, the thinking block could consume that whole budget and end the turn atlengthbefore a visible answer or tool call.Why This Change Was Made
Bedrock simple-option resolution now carries the model-backed
maxTokensinto Fable, mandatory adaptive, and explicit adaptive-thinking requests when the caller did not setmaxTokens. Explicit callermaxTokensremains the override path, and the existing adaptive thinking payload and temperature behavior are preserved.User Impact
Bedrock adaptive-thinking Claude requests can use the configured model/catalog output-token cap instead of silently falling back to 4096, reducing length-truncated turns for long or high-thinking generations.
Evidence
node scripts/run-vitest.mjs extensions/amazon-bedrock/stream.runtime.test.tsfailed before the fix with 4 assertions showinginferenceConfig: {}instead of model-backedmaxTokens.env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false pnpm check:changed -- extensions/amazon-bedrock/stream.runtime.ts extensions/amazon-bedrock/stream.runtime.test.tsnode scripts/run-vitest.mjs extensions/amazon-bedrock/stream.runtime.test.ts extensions/amazon-bedrock/discovery.test.ts(2 files, 44 tests passed)pnpm test:extension amazon-bedrock(11 files, 172 tests passed)pnpm format:check -- extensions/amazon-bedrock/stream.runtime.ts extensions/amazon-bedrock/stream.runtime.test.tsgit diff --check