Repository navigation
Sanitize malformed tool-call arguments before echoing history - #168
Merged
Merged
Conversation
A truncated or empty arguments string echoed back in conversation
history makes Meta 400 the next request ('arguments must be valid
JSON'), fail-closing the pilot. Replace unparseable arguments with {}
on the wire; the journal keeps the raw response and the run continues
through the designed error-nudge path.
w4ffl35
force-pushed
the
fix/pilot-sanitize-echoed-args
branch
from
October 14, 2026 03:18
671e6ec to
b3bf49f
Compare
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.
Root cause of the three provider-or-unclassified-error aborts in the #11 fixed-harness lineage (seed-202 epoch 1, wrong-key-path-2 epochs 1-2).
Mechanism, reproduced live against OpenRouter/Meta: when a tool call's arguments string is truncated (152-char cutoff mid-string observed twice) or empty (observed once), the harness echoes it verbatim in the next request's history and Meta 400s with '
argumentsmust be valid JSON', fail-closing the pilot. Control with '{}' succeeds (gen-1791947436).Fix: toolCallMessage replaces unparseable arguments with '{}' for the wire request only. The journal keeps the raw response in llm_response_received, the run records the parse error, and the trajectory continues through the designed error-nudge/consecutive-error-stop path instead of crashing the pilot.
Tests: new synthetic case asserts the echoed wire arguments are '{}' (failed pre-fix with the malformed string echoed); full live-runner suite passes; tsc clean; check-standards 0 new; check-architecture 0 new.