Skip to content

feat(chat): let a ChatPanel show reasoning and tool steps expanded - #35688

Merged
bolichen97 merged 1 commit into
mainfrom
fix/34040-chatpanel-expand-steps
Nov 12, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/34040-chatpanel-expand-steps

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An app that embeds a session with ChatPanel can 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. ChatPanel takes only slotKey and conversationOnly, 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

  • Exposing reasoning text to app code or hooks: this only changes how the existing transcript renders.
  • Changing the main chat's defaults: both additions are off unless an app or the user turns them on.
  • Opening a finished turn's steps fold: as with today's two settings, a finished turn still gathers its tool calls behind its steps toggle.

What changed (motivation → approach → change)

Who What they get
An app <ChatPanel slotKey="…" expandSteps />: working steps show inline, and reasoning and tool rows open expanded, in that panel only
A user Settings → Chat → Transcript → Reasoning starts expanded (off by default), next to Tool calls start expanded

The 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.tsx provides one React context, ExpandStepsContext (in hooks/useToolCallsStartExpanded.ts), around its ChatPage, and the three places that already read the user's choices also read it: chat/TurnBlock.tsx treats Show Thinking Inline as on, the tool-row hook treats Tool calls start expanded as on, and chat/ThinkingBlock.tsx treats the new setting as on. Outside a panel with expandSteps the context is false and nothing changes.

The new setting is a reasoningStartsExpanded field in chat/ChatSettings.tsx, default false and coerced like toolCallsStartExpanded, with its toggle in settings/ChatPanel.tsx. ThinkingBlock reads 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 generated commandPalette/settingsRegistry.gen.ts, docs/settings-registry.generated.json and docs/ui-index.generated.json gain the new row, every catalog (i18n/locales/en.json and its translations) gets its label and hint, and docs/app-kit/api-reference.md documents the prop in the Native Chat Panel section.

Backwards compatibility

Compatible: expandSteps is a new optional prop and reasoningStartsExpanded a new chat config field that defaults to false; 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; ThinkingBlock starts 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; inside ExpandStepsContext a reasoning row and a tool group start open with both settings off and nothing is written to mc-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: expandSteps reaches ChatPage through the context only when set, and no chat config is written.
  • website/src/test/SettingsChatPanelCoverage.test.tsx: flipping the new toggle stores reasoningStartsExpanded: 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=1 and =2).

Manual verification

Rendered the real TurnBlock, ThinkingBlock and CollapsibleToolGroup from 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 ChatPanel today (left) and with expandSteps (right), during a run:

Today expandSteps
running turn, defaults running turn, expandSteps

The same turn once it finishes:

Today expandSteps
finished turn, defaults finished turn, expandSteps

The new setting, and the main chat with Show Thinking Inline and Reasoning starts expanded on:

Settings, Reasoning starts expanded on

main chat, reasoning starts expanded

A split-view pane's group of reasoning rows, with Reasoning starts expanded off (left) and on (right):

Off On
reasoning group, setting off reasoning group, setting on
Light theme

running turn, expandSteps, light

Settings, light

Related Issues

Closes #34040

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 12, 2026 00:28
@bolichen97
bolichen97 requested a review from Zedmor November 12, 2026 00:28
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ca2242550fbeaab22815d211cf9cebe59fcda402 — 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 does not.

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 expandSteps; the prop has no consumer in this repo.

What this change ships

Inventory (7 items) — 7 justified

Intent: 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.

  1. An app can mount <ChatPanel expandSteps /> to open that panel's transcript steps — justified
  2. Inside such a panel, working steps show inline whatever the user's Show Thinking Inline setting is — justified
  3. Inside such a panel, reasoning rows and tool groups start expanded, and the user's saved config is left unwritten — justified
  4. New Settings → Chat → Transcript toggle "Reasoning starts expanded", off by default — justified
  5. With that setting on, a split-view group made only of reasoning rows starts open — justified
  6. The App Kit API reference documents the new prop — justified
  7. The command-palette settings registry, the UI index and every locale catalog gain the new setting row — justified

[FIRST-PRINCIPLES-REVIEWED] ca22425

Description read

[DESCRIPTION-READ] e001c2130bed7367ed1979ac5b02012056bf8604b4d3ac201a65239a749dbef7

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 Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of ca2242550fbeaab22815d211cf9cebe59fcda402 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 .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 Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ca22425

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable ca2242550fbeaab22815d211cf9cebe59fcda402 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of ca2242550fbeaab22815d211cf9cebe59fcda402 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The new setting says "Reasoning starts expanded", but the row it opens is labelled "Thought process", and the setting beside it says "Show Thinking Inline". The blind reader noticed: "three words, and I'm only guessing they mean the same thing." Rename the setting to "Thought process starts expanded" so it uses the label the user clicks in the chat.

[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 .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 Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ca22425

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ca2242550fbeaab22815d211cf9cebe59fcda402 false-positive: <reason, 20 to 500 characters>

@KiroCrewCaptain

KiroCrewCaptain commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: 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 expandSteps prop to the app SDK's ChatPanel and a 'Reasoning starts expanded' chat setting, both off unless turned on. The panel override is a React context provided only around that panel's ChatPage, so the user's saved chat config (mc-chat-config) is never written. Outside such a panel the hooks behave exactly as on main. ThinkingBlock now passes its starting state as the fallback to useRowDisclosure, so a row the user opens or closes by hand keeps that choice, and the default stays collapsed. The new setting is added to the defaults, and a stored non-boolean reads as off, like toolCallsStartExpanded. Host sync handles each config field generically, so no allowlist needed updating, and no backend or SDK type changes are needed. The tests would fail without the change. They cover the setting, hand-closed rows staying closed, reasoning-only vs tool groups, the context forcing rows open and steps inline, ChatPanel passing the prop through, and the Settings toggle.

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 ca2242550f · 313 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@bolichen97
bolichen97 enabled auto-merge (squash) November 12, 2026 00:47
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 12, 2026
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
@bolichen97
bolichen97 force-pushed the fix/34040-chatpanel-expand-steps branch from eda38ec to ca22425 Compare November 12, 2026 12:10
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 (test_wait_discipline_ratchet.py::test_the_scan_matches_known_sites and test_updates_handlers_facade.py::test_every_name_served_from_outside_the_family_is_visible_to_type_checkers) were red on main and fixed there by #35625, which this head now carries. The previous head also conflicted with main in the generated ui-index.generated.json; it is regenerated here. The patch is otherwise unchanged.

[operator: bolichen97]

@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 12, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@bolichen97
bolichen97 merged commit 7d55b03 into main Nov 12, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/34040-chatpanel-expand-steps branch November 12, 2026 14:17
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 12, 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.

ChatPanel: let an app show reasoning and tool steps expanded, and add a 'reasoning starts expanded' setting

2 participants