Skip to content

chat: a refused propose_task spills its raw schema error into the conversation — "checks must each be ONE command with no shell composition" #890

Closed

Description

@santoshkumarradha

What happened

2026-09-11, dev@333acc67d, live drive of the chat surface, scenario 6. The model called propose_task with a composed shell command in checks. The engine refused the arguments. The person's screen got both halves of a conversation that was never theirs:

╰─ not started · the call was refused

and, opened underneath it, the refusal text itself:

Invalid arguments: checks must each be ONE command with no shell composition — "cd 1-check && ./run.sh" is not

checks, shell composition and the quoting of the offending argument are the schema talking to the model. The person is being shown a repair instruction addressed to somebody else, about a field they have never heard of, on a card that says nothing started.

Replication

Deterministic (no model). internal/tui3, through the reducer the chat uses — internal/tui3/forming_test.go already drives this exact shape (it settles a forming card with Hint: "Invalid arguments: brief is required"):

Feed the feed a session.EventToolBegin for propose_task, then

session.Event{
    Kind:   session.EventToolFailed,
    Tool:   "propose_task",
    Hint:   `Invalid arguments: checks must each be ONE command with no shell composition — "cd 1-check && ./run.sh" is not`,
    Output: `Invalid arguments: checks must each be ONE command with no shell composition — "cd 1-check && ./run.sh" is not`,
}

and render.

go test ./internal/tui3 -run TestAToolArgumentRefusalIsNotDrawnToThePerson -count=1

Expected today: the rendered frame contains not started · the call was refused and the whole Invalid arguments: checks must each be ONE command with no shell composition sentence, in an entry that opened itself.

Expected after the fix: the frame contains the card's own settled words and no Invalid arguments: text.

Field (real models). OPENROUTER_API_KEY, the chat surface, a /task whose acceptance is naturally a composed command (cd X && make test). Small models compose in checks routinely. One turn, cents.

Where — the leak, in two hops

  1. The text is written for the model. declaredCheckList in internal/session/task_checks.go returns "Invalid arguments: checks must each be ONE command with no shell composition — " + strconv.Quote(...) + " is not". That is correct and must stay: it is one repair away from a working check, which is the stated reason the door refuses rather than dropping silently.
  2. The engine puts it on the wire as a person-facing hint. internal/session/loop.go, the batch-result loop (search Kind: EventToolFailed), sends Hint: clip(firstLine(results[index].text), hintLimit) and Output: capOutput(results[index].text) — the tool's own result text, unchanged.
  3. The surface draws it and opens it. feed.closeTool in internal/tui3/feed.go, reached from f.closeTool(ev, toolFailed, firstNonEmpty(ev.Hint, errText(ev.Err))): it writes e.text = e.text + " — " + why and then sets e.open = true under the comment A FAILURE OPENS ITSELF. That law is right for a bash that failed; a schema refusal is not that kind of failure.
  4. The card beside it is app.refuseFormingCard / taskFormingRefused in internal/tui3/task.go — not started · the call was refused — which is the correct and sufficient sentence.

The fix

A tool-argument refusal is a result the model reads and repairs, and never a sentence drawn to the person — unless the model gives up on the call, in which case what the person reads is the model's own account of giving up, in its own words.

The row for a refused call says what a person can act on: the call was refused, and the model is fixing it. The schema's sentence stays where it belongs — in the tool result, in the transcript, and behind ctrl+o for somebody who asks for it — rather than being drawn expanded by default. Concretely, a failure that is an argument refusal (the engine knows: it never reached the tool's work) does not take the A FAILURE OPENS ITSELF road, and its hint is not the raw result text.

The existing sentence not started · the call was refused is already the right words and does not change.

Acceptance

  • e2e: go test -tags e2e ./internal/e2e/ (the tmux suite) — a task proposal refused on its arguments draws not started · the call was refused and the screen never contains Invalid arguments:.
  • e2e: the control — a genuinely failed bash still opens itself with its own output, so A FAILURE OPENS ITSELF is intact for the case it was written for.
  • Unit: internal/tui3 — a toolFailed entry whose failure is an argument refusal renders with open == false and with no substring of the refusal text in its drawn row; internal/session — the refusal still reaches the model verbatim as the tool result, asserted on the transcript.
  • internal/manual/chat/how-tasks-run.md (which today quotes Invalid arguments: checks must each be ONE command with no shell composition as something the screen shows) is corrected to say where that sentence goes, and the change entry's invalidates names the belief that a refused call spills its schema error into the conversation.

🤖 Generated with Claude Code


Drafted with CodeAF · reviewed and owned by the author

Activity

  1. added
    bug
    area:chat
    area:tools
    sev:serious
    on Sep 11, 2026
  2. added 13 commits that reference this issue on Sep 11, 2026
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

    area:chatarea:toolsbugsev:serious

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions