You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: a malformed tool_use name is persisted in the transcript and permanently breaks the session (400 Invalid 'input[N].name') #175
In Desktop, run a session that emits tool calls (read_directory, read_file, edit_file all observed).
At some point the run stops with: 400 Invalid_request_error Invalid 'input[70].name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_.-]+\Z'.
Press Try again, or send "continue" — the byte-identical error comes back every time. The session can no longer run at all.
Read the session transcript on disk (~/.commandcode/projects/<project>/<session-id>.jsonl) and look at the name field of tool_use content blocks.
Expected behavior
A tool_use name is always a bare tool name matching ^[a-zA-Z0-9_.-]+$. A call that cannot be represented that way should be rejected or coerced before it is persisted. At minimum, the retry path should drop or repair the offending entry instead of replaying it forever.
Actual behavior
The transcript holds tool_use blocks whose name is the entire serialized call instead of a tool name — the value starts with the tool name, then a space, then markup like </arg_key><arg_value> and the full argument text, i.e. it contains spaces, \, ", : and in one case Cyrillic characters.
Observed values (redacted shape, not the full strings):
In one 388-message session, 8 such blocks were found. Because they are stored in the transcript, every later request rebuilds the same malformed payload, the provider rejects it with 400, and the session is dead: neither "Try again" nor "continue" can recover it.
This is distinct from #105: there the offending entry is at input[280], appears intermittently, and continue succeeds immediately. Here the bad entry is persisted, it is reachable from the first request of the next turn, and no retry clears it. The session is unrecoverable and the user loses the work in it.
A related trigger, if useful: the session in question was continued across GUI restarts while providers.json gained a new BYOK provider, so the transcript was replayed against a new provider path.
Screenshots, recordings, or sanitized logs
Session: f28cafd4-5369-49f8-88d5-5704881d6335
Failing error lines are at the end of the transcript; the malformed tool_use blocks are at lines 29, 33, 41 and 228 of the same file.
Counts: 388 messages total, 8 tool_use blocks with an invalid name, 5 recorded occurrences of the 400 error.
Activity
magicprinc commentedon Nov 24, 2026