Repository navigation
fix(chat): show inherited reasoning in transcripts - #128249
gaoanze888 wants to merge 28 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed September 2, 2026, 2:14 PM ET / 18:14 UTC. ClawSweeper reviewWhat this changesThis PR derives inherited/model reasoning visibility into session rows so Control UI transcripts can show saved reasoning when the effective setting enables it. Merge readinessKeep open: the branch exposes saved reasoning for arbitrary noncanonical persisted values, contradicting the documented and recently merged rule that only explicit Priority: P1 Review scores
Verification
How this fits togetherGateway session projection combines a session override, configured defaults, and model metadata into a row consumed by Control UI. The transcript renderer then decides whether completed thinking content is visible alongside the final answer. flowchart LR
A[Session override and defaults] --> B[Gateway reasoning projection]
B --> C[Session row]
C --> D[Control UI visibility decision]
D --> E[Completed transcript]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The introduced unknown-value path weakens the explicit reasoning-visibility boundary and can expose saved model reasoning. PR surfaceSource +493, Tests +1058. Total +1551 across 39 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep completed reasoning behind the canonical effective Do we have a high-confidence way to reproduce the issue? Yes—source reproduction is high confidence: a stored Is this the best way to solve the issue? No—the effective-state projection is useful, but treating an unrecognized persisted string as enabled conflicts with the current canonical and documented visibility contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1212f991db46. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (51 earlier review cycles; latest 8 shown)
|
This comment was marked as spam.
This comment was marked as spam.
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
This comment was marked as spam.
This comment was marked as spam.
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
This comment was marked as spam.
This comment was marked as spam.
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
This comment was marked as spam.
This comment was marked as spam.
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
🦞👀 Command router queued. I will update this comment with the next step. |
Closes #79469
What Problem This Solves
Fixes an issue where completed assistant reasoning could stay hidden in Control UI when reasoning was enabled through an inherited agent/global default or through the selected model's reasoning capability instead of a session-specific
reasoningLeveloverride.Why This Change Was Made
Gateway session rows now project the effective reasoning level separately from the stored override, session-change events carry that value, and the chat transcript renderer uses it when deciding whether saved thinking blocks may be shown.
The Gateway projection consumes the per-agent prepared model catalog supplied by the Gateway session-list/read boundary without starting provider discovery. Runtime reply resolution and Gateway projection share
shouldUseModelReasoningDefault(...), so model defaults apply only when reasoning is not explicit, thinking is inactive, and thinking was not explicitly disabled. Explicit session/agent settings still win, including legacy stored non-off values such ashigh. Completed saved reasoning is shown for non-off effective levels exceptstream, which remains transient-only.User Impact
When View -> Reasoning is enabled, completed messages with saved thinking are visible for inherited reasoning-on and model-default sessions. Inherited stream-mode sessions continue to hide completed reasoning while preserving the final answer.
Evidence
Verified against commit
8dade94e203e61c586791de594ed5e6f084e0a51using a real loopbackopenclaw gateway run, isolated SQLite session/transcript stores, and the real Control UI in headless Google Chrome. No mock Gateway and no model request were used; transcripts contain fixed non-sensitive proof markers.{"id":"on","thinkingCount":1,"thinkingTextCount":1,"finalVisible":true,"reasoningVisible":true} {"id":"stream","thinkingCount":0,"thinkingTextCount":0,"finalVisible":true,"reasoningVisible":false} {"id":"model","thinkingCount":1,"thinkingTextCount":1,"finalVisible":true,"reasoningVisible":true}The
onagent inheritedreasoningDefault: "on";streaminheritedreasoningDefault: "stream";modelhad no session or agent reasoning override and consumed the reasoning-capable prepared model catalog default.Inherited
on: completed reasoning visibleInherited
stream: final visible, completed reasoning absentModel default: completed reasoning visible
Proof manifest and reproduction details
Validation
pnpm test src/agents/model-selection.test.ts src/gateway/session-utils-row.test.ts src/gateway/server.chat.gateway-server-chat.test.ts src/auto-reply/reply/get-reply-directives.target-session.test.ts src/gateway/session-event-payload.test.ts src/gateway/session-utils-owners.test.ts ui/src/pages/chat/components/chat-transcript-render.test.ts-> 259 passedpnpm check:changed -- src/agents/model-selection.ts src/agents/model-selection.test.ts src/auto-reply/reply/get-reply-directives.ts src/gateway/session-utils-reasoning.ts src/gateway/session-utils-row.ts src/gateway/session-utils-row.test.ts src/gateway/session-event-payload.ts src/gateway/session-event-payload.test.ts src/gateway/session-utils-owners.test.ts src/gateway/session-utils.types.ts ui/src/api/types.ts ui/src/pages/chat/components/chat-transcript-projection.ts ui/src/pages/chat/components/chat-transcript-render.test.ts-> passed after rebase to current mainautoreview --mode local --engine pi --thinking high-> clean, correctness 0.98AI-assisted implementation; I reviewed the prepared model-runtime boundary, shared runtime/Gateway reasoning-default policy, session-change event projection, Control UI visibility gate, real Gateway/Control UI proof, and validation output.
Exact-head lifecycle proof
Repeated after the required main rebase on current functional head
49ad9dc4c9b903b2e53314be87ec5c29de7ca7ec:2026.8.1-49ad9dc4c9b9-2026-08-30T06-40-52.027Z;sessions.patchRPC while capturingsessions.changedWebSocket frames;on: completed reasoning visible before and after the lifecycle patch;stream: completed reasoning hidden before and after the lifecycle patch;effectiveReasoningLevel:"off", every RPC succeeded, and every updated label rendered.Exact-head artifacts at immutable proof commit
2eadb12cf5457cdaf38af06cf015e1a7c4179d93:Exact-head bounded fence validation
The current head uses an active session-key fence only while a lifecycle projection awaits the prepared model catalog. The fence is released in a
finallyblock, so historical session churn is not retained in process-global state.45/45on the exact head.pnpm check:changedpassed for the bounded fence and Gateway event files.Latest head: cron listener isolation + main rebase
Exact head
0254438945f904aea41ba17a262bae677536fcaf.origin/main; the singlesessions-read.tsconflict was resolved by retaining main'sagentIdprojection alongside the extractedsessions.describehandler and prepared-catalog reasoning metadata.broadcastCronBoundSessionChangesis synchronous again, so a row-load or broadcast throw stays insideCronService.emit's synchronous isolation instead of becoming a discarded rejected promise.server-cron,sessions-read,session-utils-row,session-event-payload,server-session-events,server-session-lifecycle-events,session-lifecycle-events, andchat-transcript-render(235 tests across the rebased head).check:changedpassed production typecheck, formatting, boundaries, i18n catalog, ratchets, and all other gates through core-test typecheck; the only remaining local gate failure is unchangedui/vite.config.tsmissing apakodeclaration in the reused dependency tree, outside this diff.origin/mainmerge-tree is clean.