Skip to content

chat: a task card quotes the report's first line literally, so a report that opens with a code fence draws "`" as its outcome #889

Description

@santoshkumarradha

What happened

2026-09-11, dev@333acc67d, live drive of the chat surface, scenario 1. A quick task landed and its card drew:

"```" · started 10:45 · ctrl+o output

The quoted sentence is supposed to be what the work came to. Here it is a bare code fence, because the report the node landed with began with one:

… the actual answer …

The card took the report's first line literally, found ```, and quoted it. A person reading the row learns nothing at all, and the one line the card exists to show is spent on punctuation.

Replication

Deterministic (no model). internal/tui3 — this is a pure rendering question and needs no engine:

Build a taskDone card from a settled node whose report is

the seven files are written and the suite passes

and render app.doneUnder.

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

Expected today: the row reads "```" · started HH:MM · ctrl+o output.

Expected after the fix: the row reads "the seven files are written and the suite passes" · started HH:MM · ctrl+o output.

Field (real models). OPENROUTER_API_KEY, the chat surface, any /task or quick task whose worker answers with a fenced block first — common for anything that reports a diff, a command's output or a JSON result. One run, cents.

Where

  • internal/tui3/taskdone.go — the card is built with outcome: strings.TrimSpace(firstLine(node.report)) (search outcome: in the card constructor), and app.doneUnder quotes that value and appends · started HH:MM · ctrl+o output.
  • firstLine — internal/tui3/render.go.
  • The same first-line reading feeds the running row: app.railDoing in internal/tui3/task.go.
  • The reports themselves come from Agent.landQuickNode / quickReportOnClose in internal/session/task_quick.go and from the audit report composer in internal/session/task_audit.go; they are the model's own prose and a fence in front of them is not a defect there.

The fix

The quoted sentence is the first line of the report that says something: leading blank lines and fence markers (```, ~~~, with or without a language word after them) are skipped, and the first line of prose beneath them is what is quoted. A report that is nothing but a fenced block quotes the first line inside the fence.

A report with no prose line at all keeps today's behaviour for that case — the emptiness law, so the row falls back to the subtitle and, failing that, draws the tail alone rather than an empty pair of quotation marks.

The card's own words do not change: it is still "<sentence>" · started HH:MM · ctrl+o output.

Acceptance

  • e2e: go test -tags e2e ./internal/e2e/ (the tmux suite) — a task whose report opens with a fence draws a card whose quoted half is the prose sentence; the screen never contains "```".
  • e2e: the control — a report that opens with prose quotes exactly the same sentence it does today.
  • Unit: internal/tui3 — the first-prose-line reader, over the table: a leading fence, a fence with a language word, leading blank lines, a fence-only report, an empty report. Every road that fills a card's quoted half goes through it.
  • internal/manual/chat/reading-a-task-page.md (the card's anatomy) quotes the row's shape as it now reads, and the change entry's invalidates names the belief that the card quotes the report's literal first line.

🤖 Generated with Claude Code

Activity

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:chatThe v3 surface a person sits in front of (internal/tui3)bugSomething the code does that it should notsev:papercutA wording, a hint, a small wrongness that costs a moment

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions