Repository navigation
fix(chat): label purpose-less shell pills from the command, not the title - #8294
Conversation
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
1 similar comment
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
fdff9b2 to
537e2bc
Compare
|
CI triage note (head |
537e2bc to
16fc501
Compare
|
CI triage note (head |
16fc501 to
e5d58a6
Compare
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Spot-check real KAS/claude-acp shell descriptions: any comma-joined description whose every fragment appears verbatim in the command now silently demotes to the derived label. [DESIGN-REVIEWED] 8b8eaba |
UX Review (Fable 5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS No first-time reader has cold-read the new pill labels (raw command face, Watch
[UX-REVIEWED] 8b8eaba |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The 27-tool subcommand-attachment set rides beyond the fix: the observed defect exercises only Not justified as shipped
What this change shipsInventory (6 items) — 5 justifiedIntent: make shell step rows readable when kiro-cli omits the purpose and titles the call with argument soup — a FIX.
[FIRST-PRINCIPLES-REVIEWED] 8b8eaba |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsFINDING -- src/kiro_crew/tool_call_title.py:2034 -- mutating |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings that block. FINDING — website/src/utils/toolLabel.ts:538 — [OPUS-REVIEWED] 8b8eaba |
e5d58a6 to
bffb326
Compare
|
Disposition — GPT validation finding on |
Open PR relationship auditThis is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion. Relationship findings
No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit. |
bffb326 to
947a344
Compare
|
Rebased onto main Conflicts: none, clean rebase (no manual resolution, no behaviour change). Gates run locally in an isolated worktree: Please review the rebased branch. Note that a maintainer push makes the maintainer the last pusher, so under this repo's last-push rule a second approver is needed. Reply here if anything looks wrong. |
|
|
Round on
Mergeable; the remaining blocker is the maintainer review. |
cf1ff2a to
0066b48
Compare
|
Same-tree re-roll: |
0066b48 to
097ec43
Compare
|
|
Round on |
|
Round on |
…itle kiro-cli's injection of `__tool_use_purpose` is inconsistent for built-in shell calls. When it is absent, kiro-cli titles the call with a digest of the command's own argument fragments (`--title, --text, Three, 1. ...`), and the row rendered that soup as the pill label: rule R0.0 in utils/toolCallTitle takes any non-stub title that differs from `rawInput.command` as the model's description, which outranks the derived title in pickToolLabel. A title whose every `, `-separated fragment (trailing ellipsis stripped) occurs verbatim in the command is a digest OF the command, not a sentence ABOUT it; R0.0 now returns undefined for it so the usual derivation runs (a classified action, else the command in the code face, else the binary digest). The Python mirror carries the same guard and the shared fixture pins both sides with four new cases. deriveShellSummary steps over wrappers (`sudo`), variable references (`$PY`) and interpreters (`python3 script.py` -> `script.py`), and attaches one sub-command word to the first meaningful name -- only for tools and scripts that take one, so `cat x` stays `cat`. The observed oncall command now digests to `ledger.py ticket-log` instead of `cd`.
097ec43 to
8b8eaba
Compare
|
Rebased onto current main ( |
bolichen97
left a comment
There was a problem hiding this comment.
Approved after verification: PR Readiness success on this head, no active change requests or unresolved threads, mergeable against current main.
…itle (kirodotdev#8294) kiro-cli's injection of `__tool_use_purpose` is inconsistent for built-in shell calls. When it is absent, kiro-cli titles the call with a digest of the command's own argument fragments (`--title, --text, Three, 1. ...`), and the row rendered that soup as the pill label: rule R0.0 in utils/toolCallTitle takes any non-stub title that differs from `rawInput.command` as the model's description, which outranks the derived title in pickToolLabel. A title whose every `, `-separated fragment (trailing ellipsis stripped) occurs verbatim in the command is a digest OF the command, not a sentence ABOUT it; R0.0 now returns undefined for it so the usual derivation runs (a classified action, else the command in the code face, else the binary digest). The Python mirror carries the same guard and the shared fixture pins both sides with four new cases. deriveShellSummary steps over wrappers (`sudo`), variable references (`$PY`) and interpreters (`python3 script.py` -> `script.py`), and attaches one sub-command word to the first meaningful name -- only for tools and scripts that take one, so `cat x` stays `cat`. The observed oncall command now digests to `ledger.py ticket-log` instead of `cd`. Co-authored-by: Jingchao Cao <cjingcha@amazon.com>
Problem / Motivation
In simplified-tool-names mode the pill label is the agent-authored
__tool_use_purpose. kiro-cli's injection of that argument is inconsistent for built-in shell calls (allocated per spawned process; two sessions one minute apart were observed at 16/16 vs 0/22 execute calls carrying it). When it is absent, kiro-cli's auto-title for a bash call is a digest of argument fragments, and the pill renders it verbatim:Since #10009 the row derives its label from
rawInput.command, but rule R0.0 inutils/toolCallTitle.ts(backendShellDescription) takes any non-stub title that differs from the command as the model's description of the call, and the argument digest passes that test. The description outranks the derived title inpickToolLabel, so the soup still wins and the command reaches only the tooltip. Verified against currentmainby running this PR's threeToolCallLinecases against the unmodified implementation: both purpose-less soup-title cases still render the soup.Why it matters
Every session that lands on an untreated kiro-cli process renders unreadable step rows for its whole transcript; the reader cannot tell what any shell step did without expanding it. On current
mainthe live kiro-cli row already carries the command on its title (_select_tool_title), so the soup survives mainly on persisted rows (restored sessions, old transcripts) and on any transport whose title is a fragment digest; those rows are where the label matters most, since the live turn is over.What changed (motivation → approach → change)
Goal: the pill should be readable from ground truth (the command in the call's raw input), not from a title that is unreliable exactly when it is needed.
Approach considered and rejected: a parallel re-label path in
ToolCallLinethat bypasses the title pipeline (this PR's first shape, superseded by #10009's client-side derivation, which already owns that decision for every row). Also rejected: LLM back-fill of missing purposes (per-call cost and latency on the hot streaming path for chrome text). Chosen: teach R0.0 the difference between a description and a digest, then let #10009's derivation run.utils/toolCallTitle.tsbackendShellDescription(R0.0): a title whose every,-separated fragment (trailing…/...stripped) occurs verbatim in the whitespace-collapsed command is a digest OF the command, not a sentence ABOUT it, and returnsundefinedso derivation runs: a classified action when the command parses (List files in srcfor-la, srcoverls -la src), the command itself in the code face when it is short, the binary digest when it is flood-length. A description the model wrote carries words the command does not contain, so it never matches; the check is case-sensitive so a one-word sentence (Inspectovergit status) stays a description.src/kiro_crew/tool_call_title.pybackend_shell_description: the same guard (_is_argument_digest_of), so the channels agree with the dashboard.test/fixtures/tool_call_titles.jsongains four cases that pin both sides (digest over a parseable command, digest over a refused$PYcommand, a single lifted fragment, a one-word sentence).utils/toolLabel.tsderiveShellSummary: steps over wrappers (sudo), variable references ($PY) and interpreters (python3 script.py→script.py;python3 -c …keepspython3), and attaches one sub-command word to the first meaningful name, only for tools and scripts that take one (git,npm,make,docker, …,*.py,*.sh), socat xstayscat. The observed oncall command digests toledger.py ticket-loginstead ofcd. Two existing pins changed to strictly richer labels (make→make build,docker-compose, tee→docker-compose up, tee).ToolCallLine.tsxand the locale catalogs are unchanged frommain.Tests
utils/toolCallTitle.test.ts+test/test_tool_call_title.py: fixture conformance on both sides with the four new cases (TS 269, Python 274).toolLabel.test.ts: interpreter/varref/wrapper stepping; sub-command attaches to the first meaningful name only, and only for tools and scripts that take one.ToolCallLine.test.tsx: an argument-digest title over a short$PYcommand renders the command verbatim in the code face with no soup on the row; a flood-length command renders its 80-character raw cut with the full command on the details tooltip; an agent-authored purpose still wins.Manual verification
Screenshots below come from the fixture harness
website/scripts/capture-purposeless-shell-pill.mjsdriving the real built SPA with the persisted-row shape of the reporting session (meta.kind/input, no purpose); the harness asserts the three pill labels and that neither argument digest is on any pill before it shoots. Fullvitest run(2122 files),tsc,eslint, i18n string lint, production build; backend fixture test, black/isort/flake8,mypy --platform linux; comment-history, brand-name, black and subprocess-encoding ratchets and the harness-parity gate againstmain, all green locally.Screenshots / video
Dark: an agent-authored purpose (unchanged), a short soup-titled
$PYcommand shown verbatim in the code face, a flood-length multi-line script shown as its binary digest (ledger.py ticket-deps, tee):Light theme
Related Issues
None open upstream for this; the root cause (inconsistent
__tool_use_purposeinjection) is filed with the kiro-cli team internally, and this change makes the dashboard robust to it either way. Builds on #10009.Pattern harvest
Rule candidate: review-prompt
Pattern: "a title/summary that differs from the raw input is not thereby a description of it; when the summary is generated from the same input, check whether it is assembled from that input's own pieces before ranking it above a derivation from the input."
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)