fix(chat): label purpose-less shell pills from the command, not the title - #8294
fix(chat): label purpose-less shell pills from the command, not the title#8294jingchaodev wants to merge 1 commit into
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 All checks complete. The design holds up: real observed harm, deterministic ground-truth re-label at the display layer (the right layer for a display-data problem), the LLM alternative considered and reasonably rejected, root cause filed upstream, no test pinning the old Design-Verdict: PASS Ground-truth re-label at the display layer is the right shape; deterministic, opt-scoped, and the restored-session Suggestions
[DESIGN-REVIEWED] 947a344 |
UX Review (Fable 5, fork) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Good fix, but the hover tooltip on a re-labeled pill now shows the exact argument-soup this PR exists to remove. Watch
Evidence gaps
[UX-REVIEWED] 947a344 |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of All evidence is gathered and verified against the base tree. Producing the review. First-Principles-Verdict: CONCERNS The soup title this PR fixes still renders unfixed at two sibling Not justified as shippedAll inventory items are justified; the concern is coverage, not existence — see Watch. What this change shipsIntent: make shell tool-step rows readable when kiro-cli omits the agent-authored purpose and its auto-title is argument-fragment soup — a FIX (repro in description; new tests fail on base). Inventory (6 items)
WatchPoint patch: grepped SubtractionsShrink [FIRST-PRINCIPLES-REVIEWED] 947a344 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo blocking issues; one advisory finding. FINDING — website/src/pages/chat/ToolCallLine.tsx:742 — for a purpose-less [OPUS-REVIEWED] 947a344 |
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. |
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 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:#6435's
deriveShellSummarydoes not catch this: it only fires above 200 chars / on multi-line labels, and it parses the TITLE — which in this failure mode is not the command.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. Restored/old sessions are additionally affected (see the
isShellfix below).What changed (motivation → approach → change)
Goal: the pill should be readable from ground truth, not from a title that is unreliable exactly when it is needed, and it should read in the same verb-led register as agent-authored purposes ("Read the full ticket …" beside "Run ledger.py ticket-log").
Approach considered and rejected: LLM back-fill of missing purposes (per-call cost/latency on the hot streaming path for chrome text). Chosen: deterministic re-label from the call's raw input.
ToolCallLine: when a shell pill would show its raw label (no purpose, or purpose suppressed by the language guard) and the raw input carries acommand, label from the command — verbatim when short/single-line,deriveShellSummarydigest when flood-length — framed by a new catalog keypages.chat.toolCallLine.run_command("Run {{cmd}}", translated in all 12 locales + pseudolocale regen).deriveShellSummary: steps over wrappers (sudo), variable references ($PY), and interpreters (python3 script.py→script.py), and attaches one subcommand word to the first meaningful name — the observed oncall command derives toledger.py ticket-loginstead ofcd. Two existing test pins changed to strictly richer labels (make→make build,docker-compose, tee→docker-compose up, tee).commandFromToolInput(new,utils/toolLabel.ts): readscommandout of the raw-input JSON.isShell: false, so no shell derivation ever ran on old transcripts; it now reads the persistedmeta.kind === 'execute', mirroring the live branch.Tests
toolLabel.test.ts(16): interpreter/varref/wrapper stepping, subcommand attaches to the first meaningful name only,commandFromToolInputparsing and rejection shapes.ToolCallLine.test.tsx(41): soup-title pill re-labels from the command (short verbatim, flood-length derived); an agent-authored purpose still wins over the re-label; short verbatim-command titles unchanged.en-XA.Manual verification
Screenshots below were produced by the committed fixture harness (
website/scripts/capture-purposeless-shell-pill.mjs) driving the real built SPA with the exact transcript shape from the reporting session (P503465049 triage). tsc 0 errors, eslint 0 warnings at the CI cap, i18n added-lines gate clean.Screenshots / video
Dark — an agent-authored purpose (unchanged), a short command re-labeled verbatim, a flood-length command derived to its digest:
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.Pattern harvest
Rule candidate: review-prompt
Pattern: "UI fallback renders an upstream-generated summary verbatim — when the upstream summary is generated from the same missing data that triggered the fallback, derive from ground truth (raw input) instead."
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)