Repository navigation
fix(ui): hide saved Codex reasoning unless enabled - #136008
Conversation
Preserve native Codex reasoning as typed thinking rather than ordinary answer text. Keep reasoning-only activity out of heartbeat suppression and final reply grouping, while retaining visible mixed-content answers. Show saved reasoning only with /reasoning on and the local visibility toggle; keep off and stream hidden through history reload and Worked expansion. Remove obsolete mirror-factory plumbing and cover native event projection, SQLite persistence, normalization, grouping, and real browser behavior. Existing malformed historical rows are not rewritten and channel previews are unchanged. Fixes #135978
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 2:17 AM ET / 06:17 UTC. ClawSweeper reviewWhat this changesThe PR stores Codex reasoning as typed thinking content and shows saved reasoning in Control UI only for an explicit Merge readinessKeep open. The branch still addresses a current-main Codex transcript defect, and the prior P1 concern was resolved by correcting a fixture to the supported visibility enum; no introduced blocking defect was found. Priority: P1 Review scores
Verification
How this fits togetherCodex app-server events enter the Codex plugin, which mirrors transcript records into OpenClaw session history. The Gateway supplies that history to Control UI, where typed reasoning is separated from final replies and completed work. flowchart LR
A[Codex app-server events] --> B[Codex plugin projector]
B --> C[Typed reasoning record]
C --> D[SQLite transcript mirror]
D --> E[Gateway history]
E --> F[Control UI transcript]
F --> G[Worked and reasoning visibility]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +243, Docs +3. Total +255 across 21 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. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the producer-owned typed reasoning representation and apply the existing Control UI visibility controls so only explicit Do we have a high-confidence way to reproduce the issue? Yes—current-main source shows the plain-text mirror producer, and the PR provides focused SQLite and browser paths for the affected transcript flow; this review did not execute them. Is this the best way to solve the issue? Yes—the producer emits the canonical typed content, allowing existing normalization, grouping, and visibility controls to handle it without prefix-based filtering or a new setting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bdfc22bffbec. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Addressed the CI failure and reviewed the ClawSweeper finding/Rank-up moves against the owning contract.
The history-navigation fixture had confused these fields. e429f2a changes its two node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.history-recovery.e2e.test.ts ui/src/e2e/chat-reasoning-visibility.e2e.test.ts
node scripts/check-changed.mjs -- ui/src/e2e/chat-flow.history-recovery.e2e.test.tsThe P1 compatibility finding is therefore not accepted: a permissive test fixture does not establish a supported persisted contract. Both Rank-up moves are explicitly skipped as proposed: preserving Production code is unchanged from the reviewed head. Existing inspected synthetic before/after screenshots remain in the PR body; none were re-uploaded. Historical malformed rows remain a separate, approval-gated data repair. Exact-head CI is running for |
|
Land-ready preparation completed for e429f2a. Merge is intentionally waiting for the lead checkpoint; no merge/deploy/release has been run. The producer-owned typed-thinking repair and explicit-session on-only + local Reasoning toggle behavior are unchanged from the reviewed patch. The only follow-up was the two-line history-navigation fixture correction in e429f2a, preserving all assertions. Production is +50/-41 (net +9), tests +311/-68 (net +243), docs +5/-2. Exact-head CI 33597696413, attempt 1 completed successfully, including build, the previously failing UI shard, and openclaw/ci-gate. The original failed run was diagnosed, not bypassed. Fresh Codex autoreview after the correction was scoped-clean at the configured P0 threshold. node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/chat-flow.history-recovery.e2e.test.ts ui/src/e2e/chat-reasoning-visibility.e2e.test.ts
node scripts/check-changed.mjs -- ui/src/e2e/chat-flow.history-recovery.e2e.test.ts
node scripts/watch-pr-ci.mjs 136008 e429f2a1e0e6f79e2162c17dc6fe8db8a1f2da1e
scripts/pr review-validate-artifacts 136008
OPENCLAW_TESTBOX=1 scripts/pr prepare-run 136008The browser pair passed 12/12, and changed-file checks passed. The original 741 focused tests, SQLite projector-to-mirror read-back, Chromium sibling proof, and full build remain recorded in the PR body. Native prepare passed at 2026-09-02 06:22:40 UTC, verified matching local/remote head trees, and reused exact-head hosted CI ( The latest ClawSweeper review, reviewed 06:17:48 UTC on this exact head, has no actionable findings and acknowledges the corrected fixture. The prior finding and Rank-up proposals were addressed explicitly. The intentional change that hides saved reasoning for Four inspected synthetic before/after screenshots are already in the PR body; no re-upload. Proof uses real Chromium with synthetic Gateway/native events and temporary SQLite, not a live provider/channel run. Existing malformed historical rows are not rewritten; that and the external native session catalog conversion remain separate work. No production service restart or state writes. |
|
Merged via squash.
|
* fix(ui): honor reasoning visibility in saved Codex replies Preserve native Codex reasoning as typed thinking rather than ordinary answer text. Keep reasoning-only activity out of heartbeat suppression and final reply grouping, while retaining visible mixed-content answers. Show saved reasoning only with /reasoning on and the local visibility toggle; keep off and stream hidden through history reload and Worked expansion. Remove obsolete mirror-factory plumbing and cover native event projection, SQLite persistence, normalization, grouping, and real browser behavior. Existing malformed historical rows are not rewritten and channel previews are unchanged. Fixes openclaw#135978 * test(ui): use valid reasoning visibility in history fixture
Closes #135978
Additional instructions
Maintainers can push to this same-repository branch.
What Problem This Solves
Fixes an issue where users who disabled reasoning would still see a
Codex reasoning:block as ordinary assistant-answer text in Control UI after a Codex turn completed or the transcript reloaded. The related reasoning-only display path also hid intentionally enabled reasoning or grouped it with the final answer instead of completed work.Why This Change Was Made
The Codex plugin now preserves standard typed
thinkingcontent through the existing transcript mirror, and Control UI preserves that type through normalization, distinguishes it from heartbeat acknowledgments and final replies, and renders it inside completed work. Saved reasoning is visible only when the session uses/reasoning onand View → Reasoning is enabled;off,stream, and missing values do not opt into saved reasoning display.The old generic title-based mirror constructor and callback plumbing are removed. There are no new settings, protocol/schema changes, provider defaults, or prefix-matching compatibility paths. Existing malformed historical rows are not rewritten, and supported channel streaming previews are unchanged. The separate native external-session catalog view is not part of this repair.
User Impact
Reasoning no longer appears as answer text in newly recorded Codex dashboard turns when it is disabled. When explicitly enabled, it is available inside Worked without hiding the final answer. The behavior survives reload, works with and without tool calls, and respects the local visibility toggle. Mixed text/media answers and actual heartbeat acknowledgment suppression remain intact.
Evidence
Reproduction and owner boundaries
/reasoning offfollowed by another completed turn containing a plain-text reasoning row. No private session content or original screenshots are published here.type: "text"; the malformed shape remains present in thev2026.8.1source tag.event_mapping.rs:378–395keeps summary/raw reasoning notifications distinct from assistant text.ononly.Automated validation
741 focused tests passed across Codex projection/mirroring, Gateway display projection, and UI normalization/grouping/rendering. The SQLite regression was rerun after replacing its incomplete fixture with the existing lifecycle-managed projector fixture: 50/50 passed.
20 browser cases passed for the initial repair, covering reasoning, completed work, tool outcomes, and heartbeat rollups. After the explicit on-only requirement, all six reasoning cases passed: off/on/stream × with/without tools, including reload and the local View → Reasoning toggle.
The full changed gate passed after the fixture correction. UI typecheck, targeted lint, formatting, and
git diff --checkalso passed after the on-only follow-up. A full localpnpm buildpassed before the initial push, including runtime bundles, public SDK declaration checks, external plugin builds, and the production Control UI. Fresh Codex autoreview at its configured P0 threshold found no blockers. This evidence uses real Chromium and temporary SQLite stores with synthetic Gateway/native-event fixtures; it is not a live provider or live channel test.Visual proof
The attached screenshots were captured from a running isolated Control UI and inspected in full. They use only synthetic conversation data and public model labels. The before case replays the pre-fix plain-text mirror shape; after cases use the canonical thinking shape verified by the producer-to-SQLite regression.
Attachments, in order: before with reasoning off; after with reasoning off; after with reasoning on and Worked expanded; after with stream mode and Worked expanded.
Scope and size
Production: +50/−41 (net +9). Tests: +309/−66 (net +243). Docs: +5/−2. The remaining production growth supplies the missing normalized thinking variant and activity/display semantics after removing duplicate mirror plumbing and consolidating assistant grouping decisions.
Related work was checked: #117365 proposes a different per-block disclosure UI, and #128249 changes inherited/default reasoning projection. Neither is closed or claimed as fully superseded by this explicit-session Codex visibility repair. Provider-tag parsing reports #89473 and #91804 and non-persistence feature request #54496 are separate scopes.