Repository navigation
fix(chat): show inherited reasoning in transcripts - #137170
gaoanze888 wants to merge 2 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 5, 2026, 2:17 AM ET / 06:17 UTC. ClawSweeper reviewWhat this changesThe PR projects inherited reasoning settings into Gateway session responses and uses them to decide whether saved thinking appears in Control UI transcripts. Merge readiness⛔ Blocked before merge - 6 items remain This remains useful work that current main does not implement. The earlier visibility and event-payload corrections are present, but the previously reported history-refresh defect remains unresolved. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway combines session overrides, agent defaults, and prepared model information into session metadata. Control UI reconciles that metadata with history and live events before deciding whether to display saved thinking. flowchart LR
A[Session overrides and agent defaults] --> C[Gateway effective reasoning]
B[Prepared model catalog] --> C
C --> D[Session snapshots and events]
D --> E[Control UI reconciliation]
E --> F{Reasoning on and View enabled}
F --> G[Show saved thinking]
F --> H[Hide saved thinking]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +113, Tests +309. Total +422 across 12 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Mantis proof suggestionWeb UI chat proof can directly show whether saved reasoning survives history refresh and session updates. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Reuse one reasoning-default policy and identity-aware session reconciliation so inherited on survives refreshes while explicit off and stream remain hidden. Do we have a high-confidence way to reproduce the issue? Yes, from source: reconcile a catalog-backed model-default row with a same-session catalog-less history row, and the new effective value disappears. This review did not execute that sequence. Is this the best way to solve the issue? Not yet: server-owned effective projection is appropriate, but the patch must complete history reconciliation and reuse the existing runtime eligibility policy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0007cbf8e4c5. LabelsLabel justifications:
EvidenceWhat 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 (6 earlier review cycles)
|
…s clawsweeper findings - effectiveReasoningLevel now serialized in gateway session event payload (Finding 1) - resolveGatewaySessionReasoningLevel falls back to off instead of raw stored value (Finding 2) - showReasoning requires canonical on (Finding 2) - rebased onto current main (a72ff7a)
This comment was marked as spam.
This comment was marked as spam.
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
…veReason, test gate) - Finding 1 [P1]: session-event-payload.ts effectiveReasoningLevel now uses conditional spread (omit when undefined) instead of `?? null`. The prior `?? null` converted a catalog-unknown value to null, which reconciliation interpreted as a tombstone clearing an already-on row from a prior sessions.list snapshot. Omitting the field preserves the prepared value. - Finding 2 [P1]: restore `archiveReason: sessionRow.archiveReason ?? null` at session-event-payload.ts:44. The prior bot-fix tree dropped the field and its null tombstone; UI reconciliation needs the null form to remove a stale archive notice after unarchiving, and existing coverage requires both forms. - Finding 3 [P1]: chat-transcript-render.test.ts legacy-coverage case now asserts `.chat-thinking` is null for `reasoningLevel: "high"` with no effective level, matching the production canonical-on visibility gate.
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:
|
|
🦞👀 Command router queued. I will update this comment with the next step. |
What Problem This Solves
Completed assistant reasoning could stay collapsed in the Control UI transcript when reasoning was enabled through an inherited agent/global default or the selected model's reasoning capability — rather than a session-specific
reasoningLeveloverride. The transcript renderer only consulted the stored override, so even though saved thinking blocks existed, they never rendered because no override matched.Closes #79469.
Change
Project the effective reasoning level on gateway session rows, separately from the stored override, and let the transcript renderer consult it.
src/gateway/session-utils-reasoning.ts(new) —resolveGatewaySessionReasoningLevelcomputes the effective level from the loaded session + prepared model catalog, reusingresolveReasoningDefault/resolveConfiguredThinkingDefaultCore/resolveAgentConfig.src/agents/model-selection.ts— newshouldUseModelReasoningDefault: a model default applies only when reasoning is not explicit, thinking is inactive, and thinking was not explicitly disabled. Keeps model defaults from clobbering explicit settings.src/gateway/session-utils-row.ts+session-utils.types.ts+session-utils-model.ts—buildGatewaySessionRowcalls the resolver and addseffectiveReasoningLevelto the projected row (and tolerates a catalog lookup rejection).ui/src/pages/chat/components/chat-transcript-projection.ts+ui/src/api/types.ts— the transcript renderer readsactiveSession.effectiveReasoningLevel; non-off effective levels (exceptstream, which stays transient) now allow saved thinking blocks to render.Behavior
reasoningLevelstill wins, including legacy stored non-off values such ashigh.streamremains transient: thinking is shown live while streaming but not persisted/displayed after completion.Evidence
Local validation on a worktree rebased onto current
origin/main(64f4cdac8), zero conflicts:npx vitest run src/agents/model-selection.test.ts src/gateway/session-utils-row.test.ts→ 141 passed (141), including the newshouldUseModelReasoningDefaulttruth table and 5buildGatewaySessionRowcases: "projects inherited reasoning defaults separately from the stored override", "projects the prepared model reasoning default when no override exists", "omits an unknown model reasoning default without a catalog", "keeps per-model thinking defaults from enabling model reasoning defaults", "preserves legacy stored non-off reasoning values in the effective projection".npx tsc --noEmit -p tsconfig.core.json→ clean for the 11 changed files (the only diagnostic,chat-turn-router.ts:188, is pre-existing and reproduces on pristineorigin/mainwith no PR changes; it is a@typesresolution artifact of the symlinkednode_modulesand is not seen by CI's real install).observeLifecycle,transcriptUnsub,tryBeginGatewaySuspendAdmission,onSessionLifecycleEvent, …), so the scoped change is self-contained.Diff: 11 files changed, +417/-4.