fix(agents): preserve fallback tool-call hints#99851
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 2:39 AM ET / 06:39 UTC. Summary PR surface: Source +4, Tests +4. Total +8 across 2 files. Reproducibility: yes. at source level: current main normalizes native Claude CLI Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow shared-predicate formatter fix after required checks complete and maintainers accept the fallback retry context behavior change. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main normalizes native Claude CLI Is this the best way to solve the issue? Yes: using the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cafbd745c1b1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +4. Total +8 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
|
|
Land-ready proof for head
No known proof gaps remain for the changed surface. |
|
Merged via squash.
|
Follow-up to #99653.
What Problem This Solves
Claude CLI history import normalizes native
tool_useblocks to OpenClaw's provider-neutraltoolcallshape. Cross-provider fallback formatting still checked only for rawtool_use, so tool-call hints disappeared from the fallback context while tool results remained.Why This Change Was Made
The fallback formatter now uses the shared
isToolCallBlockcontract instead of duplicating one provider spelling.Tests cover both sides of the boundary:
toolcall;tool_use, passes through importer normalization, and still renders the compact tool-call hint.User Impact
When Claude CLI falls back to another model, the replacement model retains the prior tool-call sequence instead of seeing missing calls or orphaned results.
Evidence
node scripts/run-vitest.mjs src/agents/command/attempt-execution.test.tsoxfmt,oxlint --deny-warnings, andgit diff --checkpassedtbx_01kwnwx0qgqrsmkyagjw77f6afpnpm check:changedpassed for core and core-tests