Skip to content

fix(crew): crewmate status line names a running tool while it streams - #19863

Merged
chenmingwei23 merged 2 commits into
mainfrom
fix/mate-chat-live-tool-line
Oct 14, 2026
Merged

chenmingwei23 merged 2 commits into
mainfrom
fix/mate-chat-live-tool-line

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A crewmate chat names the tool its crewmate is running for as long as that tool runs, instead of saying "Thinking".

In a crewmate (mate) DM, the status line above the working indicator says "Thinking" while a shell command is still running. The user sees no sign of what the crewmate is doing and thinks it is stuck. Ordinary chats draw a tool row, so they do not show this.

Why it matters

Crewmates run long builds and test suites. For all of that time the chat looks frozen, and users stop or re-ask a crewmate that is working fine.

Not a goal

What changed (motivation → approach → change)

Symptom: the line names a shell command, then says "Thinking" at its first line of output.

Root cause: a shell streams stdout as mid-stream tool_result frames (a status-less tool_call_update with content). The status line reads "the call has output" as "the call returned, the model is thinking again". The frame did not say whether it was the final one, so the client could not tell.

Change: the server now puts final on every tool_result frame (true for any terminal status, and for the text-after-tools sweep). The client marks a non-final frame's output as partial, and the status line counts a call as returned only after a final frame. A frame with no final field (an older server) reads as before.

  • src/kiro_crew/dashboard/chat_runner.py: final on both tool_result broadcasts.
  • website/src/hooks/useWebSocket.ts: passes final to the reducer.
  • website/src/store/chat/activity.ts + website/src/types/index.ts: sseToolResult sets output_partial on the tool-log entry.
  • website/src/pages/members/useSlotActivity.ts: a partial output is not a return.

Backwards compatibility

Compatible: final is a new optional field; a client that ignores it, or a frame that lacks it, behaves as today.

Removes nothing: the change only adds a field to a WS frame and a flag on the client tool log.

Tests

  • website/src/pages/members/useSlotActivity.test.tsx: a running shell keeps its label through streamed (final: false) frames, flips to thinking on the final frame, and a late partial frame does not reopen it. Red without the selector change.
  • test/test_tool_result_frame_final.py: through the real _run_chat, a streamed frame goes out final: false, a completed or failed one final: true, and the text-after-tools sweep final: true.

Determinism: both are pure state/event-driven (no clocks, no sleeps); run 3 times each with the same result.

Manual verification

N/A — unit coverage drives the real reducer, selector and runner; no browser on the authoring host.

Screenshots / video

Why no screenshot: No layout or style changes; the existing status line keeps its look and only stays on the tool label for longer, which a still image cannot show.

Related Issues

Closes #19861

Pattern harvest

Rule candidate: review-prompt
Pattern: a streamed partial event treated as the terminal one because the wire frame carries no "final" bit.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 13, 2026 18:09
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Watch a crewmate DM during a long shell build: the line should keep naming the command, then switch to "Thinking" only when the command finishes.

[UX-REVIEWED] 0ef485e

Description read

[DESCRIPTION-READ] e24e743c385f5609aa81ea634df8da8cdd704e9d139ae56301ea3e81cf233baa

That sha256 names everything this verdict read: the PR description, plus the 16 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The final bit fixes the cause, but two other readers that still treat "has output" as "has returned" are left as they are.

Not justified as shipped

  • Item 1 — symptom-level (point patch, 2 unfixed siblings): the description says "Ordinary chats draw a tool row, so they do not show this." But website/src/pages/chat/ToolCallLine.tsx:297 has isDone = e.output != null || …. The same streamed frame marks that row done while the shell is still running. website/src/app-sdk/messageRenderers.tsx:202 does the same with meta?.output != null. I grepped \.output (!==|===|==|!=) (undefined|null) and !e.output over non-test website/src. That found 3 readers that use "has output" to mean "returned", and this PR fixes only useSlotActivity.ts. ## Not a goal excludes ordinary tool rows, so this is accepted and deferred, not a demand.
    Clears when: the description names ToolCallLine.tsx:297 and messageRenderers.tsx:202 as unfixed siblings and says the fix covers only the status line, or those two readers check output_partial too.

What this change ships

Inventory (4 items) — 3 justified

Intent: let a crewmate chat show which tool is running for as long as it runs. This is a FIX.

  1. The crewmate status line keeps the running tool's label through streamed output and switches to "Thinking" only on the final frame — symptom-level (2 sibling readers left unfixed)
  2. Every tool_result WS frame now carries final (false mid-stream, true when terminal or swept) — justified
  3. A tool-log entry records output_partial, and once a call has returned, a late frame cannot reopen it — justified
  4. A frame without final, from an older server, still counts as returned — justified

[FIRST-PRINCIPLES-REVIEWED] 0ef485e

Description read

[DESCRIPTION-READ] 30decda1045f27d8899dc25fe74d513278413ecd252b203367ffe3e18fe4dc1a

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that a cancelled or interrupted turn, where no final frame ever arrives, still drops the tool label once running goes false.

[DESIGN-REVIEWED] 0ef485e

Description read

[DESCRIPTION-READ] 9e7a6cff8629b0c911e382ed7e56cbd2a5d0e750bac3cf73b9c765ca371ad2e4

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0ef485e

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0ef485e

Verdict parsed from the review's SHA-scoped output markers for commit 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0ef485e58562b21cfe54e5e8c2f5ff20caba5a99: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 13, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 13, 2026
@chenmingwei23
chenmingwei23 merged commit b0d54bc into main Oct 14, 2026
107 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/mate-chat-live-tool-line branch October 14, 2026 01:40
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crewmate chat status line says Thinking while a tool still runs

3 participants