Repository navigation
Description
What happened
On 2026-09-02, dev@09f1b3df, a real v3 chat task started from a folded multi-line paste appeared in the task rail as:
paste 1
The taskname call completed in 385 ms on deepseek/deepseek-v4-flash-0731; it received the full request, but the shared name cleaner accepted the paste transport label as a finished name. The task itself was admitted about 16 seconds later, so this was neither missing context nor a blocking name call.
The same audit found related text-boundary failures:
- every line beginning with
/is consumed by the command dispatcher, so/api/v1 returns 500,/user, or/Users/alice/repo fix thisnever reaches chat or task routing; - folded paste contents are not unfolded before inline
/task, inline/standing, or a picked harness, so those doors receive[paste 1 · N lines]instead of the person's text; - paste expansion uses textual
ReplaceAll, so a literal lookalike such as[paste 1 · 4 lines]elsewhere in the same draft is also replaced and the person's text is mutated; - the session-title role runs synchronously after
EventTurnDone, leaving the session marked running while a cheap naming call is still in flight; - slash command tokenization only splits on an ASCII space, so a tab or newline after a valid command word is misclassified.
No core transport escaping defect was found: once submitted, quotes, slashes, backslashes, Unicode, code fences, $, and @ are carried as ordinary Go strings.
Replication
Deterministic (no model).
From a clean checkout of dev@09f1b3df:
go test ./internal/session -run 'Test.*(TaskName|Title)' -count=1
go test ./internal/tui3 -run 'Test.*(Slash|Paste|Task|Harness|Standing)' -count=1The current pure helpers accept cleanTaskName("paste 1:") == "paste 1". A fake-agent v3 app consumes /api/v1 returns 500 as unknown command: /api/v1 instead of submitting it. A folded paste followed by an inline /task marker hands the fake task door the visible chip token rather than the fenced paste contents.
Field (real models).
With OPENROUTER_API_KEY set, run the isolated tagged regression added by the fix:
go test -tags e2e -run '^TestTaskNamingE2E$' -count=1 -timeout 8m -v ./internal/e2e/It must pin the talk, shaper, task-name role, and tier fallbacks to exact model deepseek/deepseek-v4-flash-0731, start one disposable task from a paste-wrapped path-heavy request, observe a meaningful name, and cancel the task immediately. Expected cost is below one cent and expected wall time is under two minutes.
Where
enterLineandslashininternal/tui3/input.goandinternal/tui3/app.gohomeEnterandhomeView.runLabelininternal/tui3/home.gocomposed/unfoldPastesininternal/tui3/pastechip.go, plus the task, standing, and picked-harness send doorscleanTitle,maybeTitle,taskNameNeeded,cleanTaskName, andnameAheadininternal/session/title.goandinternal/session/taskname.go- model-proposed task title admission in
internal/session/task.go, and planner-node validation ininternal/orchestrate - slash command parsing in
internal/tui3/app.go
The fix
Make the syntax boundary explicit and shared:
- only a recognized slash command or alias owns a leading slash; unknown slash-prefixed input is ordinary text and is submitted unchanged on chat and Home;
- real dropped files and real workspace folders retain their existing meanings, and known commands continue to dispatch;
- every route that speaks for the composer consumes the same composed payload exactly once, unfolding paste chips while retaining the compact shown text;
- paste unfolding replaces only the tracked chip occurrence, never identical literal text the person typed;
- naming sees the meaningful payload rather than transport scaffolding, and the shared cleaner rejects generic ordinal labels such as
paste 1,task 2,part 3,step 4, andnode 5without rejecting semantic names such asissue 252 checkorphase 2 rollout; - shaper titles,
propose_tasktitles, and orchestrated planner-node titles pass the same validity law before they can suppress asynchronous naming; - a rejected ahead name falls through asynchronously to one retry from the shaped summary and brief;
- session naming runs after the first turn without keeping the session in its running/steering state;
- command splitting recognizes Unicode whitespace while preserving the argument text apart from documented outer trimming.
Acceptance
- e2e: A real
deepseek/deepseek-v4-flash-0731run receives a paste-wrapped request containing paths, quotes, backslashes, Unicode,$, and@; the task is admitted without waiting for naming and its persisted/published title becomes a meaningful two- or three-word label, never a paste/task ordinal. - e2e: Through the fake-agent v3 chat and Home doors,
/api/v1 returns 500,/user,// literal, and/Users/alice/repo fix thisare submitted exactly once and unchanged;/help, a command alias, a real dropped file, and a real workspace folder keep their existing behavior. - e2e: Folded paste contents reach inline
/task, inline/standing, and a picked harness in full, while the visible transcript/card retains the compact paste chip and the paste is consumed exactly once. - Unit: A literal string identical to a visible paste token remains literal when a real paste chip is unfolded elsewhere in the same draft.
- Unit: Generic ordinal names and paste/fence scaffolding are rejected or removed consistently by session, task, shaper,
propose_task, planner-node, resume-healing, and ahead-name paths; semantic numbered names remain valid, and a rejected ahead result causes exactly one non-blocking fallback rename persisted to the checkpoint. - Unit: A blocked session-title provider cannot keep the session in running/steering state after the turn is done; the title may land and persist later, exactly once.
- Unit:
/taskarguments containing tabs/newlines, absolute paths, spaces, quotes, backslashes, Unicode,$, and@reachStartTaskbyte-for-byte apart from documented outer trimming. - The chat manual explains that only recognized leading slash words execute and that unrecognized leading slash text is sent as prose. The change entry invalidates the former all-leading-slashes-are-commands rule.
Drafted with CodeAF · reviewed and owned by the author
Activity
santoshkumarradha commentedon Sep 2, 2026
Additional race found by the required real-provider regression:
An immediate task cancellation could land after
runFrontierpublishedTaskRunningbut beforerunTaskNodeinstalled its cancellation handle.Cancelfinalized the apparently handle-less task and closednode.done; the already-scheduled runner then continued, overwrote the terminal state, andTaskGraph.completeclosed the channel again, panicking withclose of closed channel.The fix makes cancellation-handle installation the lifecycle ownership boundary. If cancellation wins, the booked lane is returned and the late runner exits before work; if the runner wins, cancellation cuts its context and the runner remains the sole finalizer. A deterministic barrier test repeats the pre-handle race under
-race.The paid E2E is now sequential so it proves both real-wire contracts without making them contend: one exact
paste 1task is immediately cancelled but must asynchronously rename and persist; a second pre-named task sends the same path/quote/backslash/Unicode/$/@document to the real worker, which must echo the hostile literal exactly.santoshkumarradha commentedon Sep 2, 2026
Landed in #483 (
dev@5e0fa6b9).The apparent provider hang was not one deadlock. The audit isolated three independent lifecycle failures:
The merged regression suite covers task/session naming ownership, immediate-cancel runner ownership, arbitrary slash/path/paste text, every paste lifecycle/send door, and provider-wire effort precedence. The real tagged OpenRouter E2E passed twice after the final fix. The final rebased run admitted the cancelled task in 17 ms, asynchronously persisted
narrow path audit, and had a seconddeepseek/deepseek-v4-flash-0731worker echo the hostile literal exactly ($0.003420, 13.56 s).PR CI passed: required gate 2m44s; full touched-package job 13m20s.