Skip to content

[Bug]: a malformed tool_use name is persisted in the transcript and permanently breaks the session (400 Invalid 'input[N].name') #175

Backlog

Description

@magicprinc

GUI version

0.1.63

Operating system

Windows 10

Reproduction steps

  1. In Desktop, run a session that emits tool calls (read_directory, read_file, edit_file all observed).
  2. 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'.
  3. Press Try again, or send "continue" — the byte-identical error comes back every time. The session can no longer run at all.
  4. 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):

read_directory <space> <drive>:\<path></arg_key><arg_value>...
read_file" <drive>:\<path>...
edit_file <space> ...

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

Safety check

  • I removed credentials and private project information from this report.

Activity

  1. magicprinc commented on Nov 24, 2026

    @magicprinc
    Author
    image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions