Repository navigation
feat(chat): let a ChatPanel show reasoning and tool steps expanded - #35688
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: both additions are opt-in, issue #34040 asks for each by name, and both build on the existing disclosure hooks rather than adding a second mechanism. Not checked: whether the external app named in #34040 actually adopts What this change shipsInventory (7 items) — 7 justifiedIntent: let an app's embedded chat, and optionally a user's own chat, show the agent's reasoning and tool steps open without clicking every row. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] ca22425 Description read[DESCRIPTION-READ] e001c2130bed7367ed1979ac5b02012056bf8604b4d3ac201a65239a749dbef7 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: both additions are opt-in and off by default, they reuse the existing disclosure hooks, and the panel's override stays in a React context so it never writes the user's shared chat config. [DESIGN-REVIEWED] ca22425 Description read[DESCRIPTION-READ] 6af591a0c92be21029e7470ea893177f5cac62615b0c10bef32cc154fbacdd59 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 |
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: |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS No blocker. All new states and the new toggle appear in screenshots, and the blind reader read the toggle and both panel modes correctly. Notes
[UX-REVIEWED] ca22425 Description read[DESCRIPTION-READ] 75d9fdace85259dac8d35abd7fa2d932a245b6806cb3a0ddc276c0ab85e9f556 That sha256 names everything this verdict read: the PR description, plus the 13 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: |
Code change approver recommendation: ApproveWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. I'm approving. The PR adds an optional An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
An app that embeds a long agent run with ChatPanel shows its "Thought process" rows and tool groups collapsed, one click per row away, and the reasoning row has no setting that opens it at all. ChatPanel takes an optional expandSteps prop. Inside that panel only, the transcript shows working steps inline and opens reasoning and tool rows, as if Show Thinking Inline, Tool calls start expanded and the new Reasoning starts expanded setting were all on; the user's saved chat config is never written. Rows the user opens or closes keep that choice. Settings > Chat > Transcript gains "Reasoning starts expanded" (default off), read by ThinkingBlock as its initial disclosure. Main chat defaults are unchanged. Closes #34040
eda38ec to
ca22425
Compare
|
Rebased: main moved in docs/app-kit/api-reference.md, src/kiro_crew/docs/settings-registry.generated.json, src/kiro_crew/docs/ui-index.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts and the website/src/i18n/locales/*.json catalogs since this head went green (09da68e -> cc6f795); CI re-running. The previous head's red Backend Tests nodes ( [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
I reviewed head ca22425 and found nothing that blocks a merge. Checks done: ExpandStepsContext defaults to false and is provided only around ChatPage in the App SDK ChatPanel. TurnBlock, ThinkingBlock and the tool hooks only OR the context in, so outside such a panel the behaviour matches main. The new reasoningStartsExpanded field defaults to off and is coerced like toolCallsStartExpanded. All 13 locale catalogs, the settings registry, the ui-index and the api-reference prop row are updated. Each production hunk has a test that fails when that hunk is reverted. PR Readiness is green on this head.
Done well: the override never writes the user's synced mc-chat-config, and a test checks that. The setting is passed in as the disclosure fallback, so a row the user opens or closes by hand keeps that state after it remounts.
Optional:
- The UX lane suggested renaming the label to "Thought process starts expanded" so it matches the row label in the chat. Right now one feature uses three names (Reasoning, Thinking, Thought process). Either rename it or reply with one line on why "Reasoning" stays. Renaming later means another pass over every catalog.
Problem / Motivation
Goal: An app that embeds a session with
ChatPanelcan show the agent's reasoning and tool steps expanded, and a user can choose that reasoning rows start expanded.An app built around a long agent run embeds the session with
<ChatPanel slotKey conversationOnly />. In that transcript every "Thought process" row and tool group is collapsed, so the reasoning is one click per row away during a run the user is watching.ChatPaneltakes onlyslotKeyandconversationOnly, so the app cannot ask for anything else, and the reasoning row has no setting that opens it at all.Why it matters
Testers of such an app call the run a black box and say the reasoning "is better explained in plain Kiro". The two settings that help today (Show Thinking Inline, Tool calls start expanded) are hidden in Settings, change every chat rather than the app's, and neither opens the reasoning row.
Not a goal
What changed (motivation → approach → change)
<ChatPanel slotKey="…" expandSteps />: working steps show inline, and reasoning and tool rows open expanded, in that panel onlyThe panel must not write the user's saved chat config, because that config is shared by every chat and synced to the host. So
app-sdk/ChatPanel.tsxprovides one React context,ExpandStepsContext(inhooks/useToolCallsStartExpanded.ts), around itsChatPage, and the three places that already read the user's choices also read it:chat/TurnBlock.tsxtreats Show Thinking Inline as on, the tool-row hook treats Tool calls start expanded as on, andchat/ThinkingBlock.tsxtreats the new setting as on. Outside a panel withexpandStepsthe context isfalseand nothing changes.The new setting is a
reasoningStartsExpandedfield inchat/ChatSettings.tsx, defaultfalseand coerced liketoolCallsStartExpanded, with its toggle insettings/ChatPanel.tsx.ThinkingBlockreads it as the starting state of its existing row disclosure, so a row the user opens or closes by hand keeps that choice, and a group of reasoning rows alone (chat/CollapsibleToolGroup.tsx, the "Worked through N steps" row of a split-view pane) starts open with it too. The generatedcommandPalette/settingsRegistry.gen.ts,docs/settings-registry.generated.jsonanddocs/ui-index.generated.jsongain the new row, every catalog (i18n/locales/en.jsonand its translations) gets its label and hint, anddocs/app-kit/api-reference.mddocuments the prop in the Native Chat Panel section.Backwards compatibility
Compatible:
expandStepsis a new optional prop andreasoningStartsExpandeda new chat config field that defaults tofalse; an app that passes neither, and a user who never turns the setting on, see today's transcript. An older host ignores the prop.Removes nothing: the diff only adds a prop, a context, a config field and a settings row.
Tests
website/src/test/reasoningStartsExpanded.test.tsx(new): the setting defaults to off and a stored non-boolean reads as off;ThinkingBlockstarts collapsed with it off, expanded with it on, and a row closed by hand stays closed across a remount; with it on, a reasoning-only group starts open and a tool group stays collapsed; insideExpandStepsContexta reasoning row and a tool group start open with both settings off and nothing is written tomc-chat-config; and a turn with Show Thinking Inline off shows its working step inline inside the context, where it folds without it.website/src/test/ChatPanel.test.tsx:expandStepsreachesChatPagethrough the context only when set, and no chat config is written.website/src/test/SettingsChatPanelCoverage.test.tsx: flipping the new toggle storesreasoningStartsExpanded: true.Determinism: the three files above (147 tests) passed 20 times with one worker and no file parallelism, 10 times with 4 workers, and in two shuffled orders (
--sequence.shuffle --sequence.seed=1and=2).Manual verification
Rendered the real
TurnBlock,ThinkingBlockandCollapsibleToolGroupfrom this head in an isolated capture page (no gateway, no data home): a turn in three states, and a split-view group of reasoning rows with the new setting off and on; plus the real Settings → Chat → Transcript panel with its gateway answers stubbed. Each capture asserted the expected disclosure state and that the panel state wrote no chat config before the screenshot was taken.Screenshots / video
An app's
ChatPaneltoday (left) and withexpandSteps(right), during a run:expandStepsThe same turn once it finishes:
expandStepsThe new setting, and the main chat with Show Thinking Inline and Reasoning starts expanded on:
A split-view pane's group of reasoning rows, with Reasoning starts expanded off (left) and on (right):
Light theme
Related Issues
Closes #34040
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)