Repository navigation
fix(subagent): print spawn list rows without terminal controls - #20361
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check that operators can still read the What this change shipsInventory (4 items) — 4 justifiedIntent: let an operator read
[FIRST-PRINCIPLES-REVIEWED] 7babfe8 Description read[DESCRIPTION-READ] 6b4a1272ce6f7cf10c79f2a642e359eace14441fe66f7feee20d463c3107c3cb That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that cutting the task at 60 characters after [DESIGN-REVIEWED] 7babfe8 Description read[DESCRIPTION-READ] 4d3aec14f52af3e8acee81c05adb29ac10a51d91cfb185ecc9bc38a4c2980af1 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
agent: answer to the Design punchline on
|
5c3b5c0 to
7babfe8
Compare
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and readiness passed at 7babfe8; no behavior change.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (3 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: spawn list rows pass the agent-authored id and task through the existing terminal-line sanitizer, with tests for escape sequences and forged rows.
Problem / Motivation
Goal:
kirocrew spawn listprints a subagent's id and task as plain text, so a task can never move the operator's cursor, retitle the window or fake a row.A spawn's
taskis written by an agent.spawn listprinted it raw. An ESC, CSI or OSC sequence in it reached the operator's terminal live, and a newline in it started a line that looked like a real row. The same gap was fixed on release/0.8.0 during the #16388 backport; main never got it.Why it matters
Anyone who runs
kirocrew spawn listreads text a model wrote. A hostile or confused task could clear the screen, rewrite the title, or print a fake✅ ... donerow. The fix only makes output stricter.Not a goal
queued_wait_textis built by the CLI from fixed reasons, not from agent text.safe_terminal_line, the helper the other CLI error lines already use.What changed (motivation → approach → change)
Symptom:
spawn listprintedq['id'],q.get('task'),a['id']anda.get('task')raw. Cause: the two row loops build their f-strings straight from the gateway JSON. Change, insrc/kiro_crew/cli_commands.py: one small helper,_spawn_row_text, passes the id and the task throughsafe_terminal_linebefore the 60-character cut, and both the queued and the running loop call it.The second half of #16698 asked for a behaviour pin on the trusted wait identity at the main handle's
ToolCallStateconstruction. The code there was already right (mcp_server_nameis set only whenmcp_identity_trusted); only the pin was missing, so this PR adds the test and no source change for it.Backwards compatibility
Compatible: a normal id and task print exactly as before. Only control bytes are dropped, and a newline in a task prints as the visible
\x0a.Removes nothing: no flag, key or output field goes away.
Tests
test/test_cli.py::TestSpawnCliAuth::test_spawn_list_queued_row_prints_no_terminal_controls: a queued row with ESC, OSC, BEL and a newline-forged row prints on one line with no control byte. Red on main, green here.test/test_cli.py::TestSpawnCliAuth::test_spawn_list_running_row_prints_no_terminal_controls: the same for a running row. Red on main, green here.test/test_acp_liveness.py::test_main_dispatch_names_the_server_only_from_a_trusted_identity: a trusted tool-call event names its server on the in-flight call; an untrusted one gets an empty name. Already true on main, so green on both; it fails if theif ev.mcp_identity_trustedguard is dropped.Manual verification
N/A — unit coverage sufficient. The change is a pure string transform on two print calls, and the tests drive
_spawnend to end with a canned gateway answer.Screenshots / video
N/A — no UI change.
Related Issues
Closes #16698
Pattern harvest
Rule candidate: review-prompt
Pattern: a CLI list that prints agent-authored fields without
safe_terminal_line.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.