Repository navigation
Conversation
…mi K3 These Bedrock routes reject images nested in toolResult content like GPT-5.6 Sol does. Reuse the existing relocation for them, moved to a sibling module because stream.runtime.ts is over its line cap. Fixes openclaw#186753
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesExtends Bedrock’s existing tool-image relocation to GPT-6 Sol, GPT-6.1 Sol, and Kimi K3. Example: The read tool returns shape.png while using global.openai.gpt-6.1-sol.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR repairs a concrete Bedrock serialization bug still present on current main, and no introduced correctness defect was found; the competing PR does not yet safely supersede it. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Amazon Bedrock plugin converts conversation history and tool results into AWS ConverseStream requests and converts streamed responses into assistant events. flowchart TD
A[Conversation and tool results] --> B[Bedrock serializer]
B --> C[Model route selector]
C --> D[Labeled sibling images]
C --> E[Nested tool images]
D --> F[AWS ConverseStream]
E --> F
F --> G[Assistant response]
Technical reviewBest possible solution: Keep the demonstrated route additions in the existing Bedrock serialization owner while preserving image bytes, contiguous tool results, associations, status, and stored history. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically emits the reported nested layout for the additional routes, corroborated by the official-release report and controlled service comparisons; this read-only review ran no target code. Is this the best way to solve the issue? The patch reuses the accepted provider-local repair without adding configuration or public APIs, and its small extraction is justified by the existing line-cap ratchet. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3e1e3652ff25. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +21, Tests +5. Total +26 across 3 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 28, 2026, 11:23 AM ET / 15:23 UTC. |
|
Closing this to stay within the repository's limit of 20 active PRs per author, because it is waiting on a live Amazon Bedrock run that I cannot provide here. The branch stays available, and I can reopen it if someone can supply that. |
Fixes #186753.
What Problem This Solves
Amazon Bedrock rejects images nested in
toolResult.contenton some image-capable routes, and the run fails with:#149336 added a relocation for this case, but its selector only matches
openai.gpt-5.6-sol. The reporter's controlled Converse comparison shows the same rejection onopenai.gpt-6-sol,openai.gpt-6.1-solandmoonshotai.kimi-k3. On each of those, the sibling-image layout is accepted and the image is described correctly. Those three routes still get the nested layout, so any image-returning tool breaks the turn on them.User Impact
Image-reading tools (for example
readon an image) work on Bedrock GPT-6 Sol, GPT-6.1 Sol and Kimi K3, just as they already do on GPT-5.6 Sol. Claude and other routes keep the nested layout unchanged.Why This Change Was Made
openai.gpt-5.6-sol,openai.gpt-6-sol,openai.gpt-6.1-solandmoonshotai.kimi-k3, matched with the samemodel.id.includes(...)rule as before.stream.runtime.tsis over its 700-line cap and the ratchet forbids growth. The relocation therefore moves verbatim intostream.tool-result-images.ts(buildBedrockToolResultUserContent), andstream.runtime.tsshrinks by 26 lines.Evidence
Tests
The existing "lifts tool images into user content … while preserving result associations" test is now parameterized over the four routes. It captures the real
ConverseStreampayload and checks the placement of the images, the placeholders, the error status of the tool result, and that stored history is not mutated. Theunaffecteddefault-model half still expects the nested layout.us.openai.gpt-5.6-solglobal.openai.gpt-6-solglobal.openai.gpt-6.1-solglobal.moonshotai.kimi-k3stream.runtime.test.tsandstream.runtime.tool-replay.test.tspass 63/63. oxfmt, oxlint andpnpm check:line-cap-ratchetare clean.Live run (Windows 11, Node 26.12.1)
This is a real
openclaw gateway runwith Telegram (local Bot API stand-in) and theamazon-bedrockprovider (bedrock-converse-stream,auth: "aws-sdk"). The provider'sbaseUrlpoints at a local ConverseStream stand-in, which speaks the AWS event-stream wire format.AWS_BEDROCK_SKIP_AUTH=1andAWS_BEDROCK_FORCE_HTTP1=1are set.read(<workspace>\shape.png), and the Gateway then sends that tool result back to Bedrock.400 ValidationException("This model doesn't support the image field for user messages. Remove image and try again.") whenever an image is nested intoolResult.content. Every other request is answered.903394cceb15691b44e02eglobal.openai.gpt-6.1-soltoolResult→ 400 ValidationException ×4 (retries). Telegram gets "toolResultwithout an image plus a sibling user image → answered. Telegram gets "shape.png shows a red square with a color gradient."global.moonshotai.kimi-k3global.anthropic.claude-sonnet-4-6(control)The stand-in only encodes the reporter's measured validation rule; it is not real Bedrock. The real-service comparison is the reporter's 24 live Converse requests in #186753.
Not covered
There is no output from real AWS ConverseStream on the three added routes. This environment has no AWS account or Bedrock credentials. The real-service evidence for these routes is the reporter's 24 live Converse requests in #186753: the nested layout is rejected and the sibling layout is accepted and interpreted on all four OpenAI/Kimi routes. This PR only selects the existing #149336 relocation for those routes, and the payload test plus the live Gateway run show the exact wire layout the fix sends. A maintainer with Bedrock access can confirm with one
readof a PNG onglobal.openai.gpt-6.1-sol.