Repository navigation
fix(ui): preserve chat history and active run timing - #119729
fuller-stack-dev merged 7 commits into
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 7:35 PM ET / 23:35 UTC. ClawSweeper reviewWhat this changesThe PR removes private reconstruction metadata before Gateway history budgeting and preserves an active run’s original start time through Control UI recovery. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessNo actionable patch defect was found, and the previous fallback-budget finding is fixed. This maintainer-authored, protected PR remains open for explicit maintainer handling because the required sibling Codex source checkout is unavailable for contract verification. Priority: P1 Review scores
Verification
How this fits togetherGateway history projects persisted session records into a bounded display payload, then sends any active-run snapshot to the Control UI. The UI replays that snapshot into visible history, tools, and the elapsed working indicator. flowchart LR
A[Session transcript] --> B[Gateway display projection]
B --> C[Remove private reconstruction metadata]
C --> D[History byte budget]
D --> E[Active run snapshot]
E --> F[Control UI recovery]
F --> G[Visible history and elapsed time]
Decision needed
Why: Repository policy requires the acting reviewer to inspect the exact Codex source before a Codex-related merge or proof-sufficiency verdict, and this read-only environment cannot supply that source. Before merge
Agent review detailsSecurityNone. PR surfaceSource +36, Tests +96. Total +132 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA redacted web-chat recovery recording would materially complement the supplied Chromium evidence for this user-visible navigation and reconnect flow. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Verify the reconstruction-metadata contract from a sibling Codex checkout, then land this single Gateway-to-Control-UI recovery path if that contract confirms the field is display-private. Do we have a high-confidence way to reproduce the issue? Yes—source shows current main drops the selected active-run start time and retains private metadata through display projection; the branch adds focused boundary and Chromium recovery coverage. Is this the best way to solve the issue? Yes, provisionally—the producer projects display data and the active-run owner carries its authoritative timestamp; direct Codex contract inspection remains required before a merge verdict. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d3d25737cf31. LabelsLabel changes:
Label 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 (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper Rank-up move disposition for exact head
No code or base update was made. |
|
Merged via squash.
|
* fix(ui): preserve chat history and active run timing * test(ui): prove reconnect preserves active timer * fix(gateway): keep recovery fallback within budget * test(gateway): keep chat abort coverage within lint budget
…cope * origin/main: (24 commits) fix(backup): skip transient gateway lock databases (openclaw#119782) test(agents): use canonical auth session fixtures (openclaw#119821) fix(memory): keep QMD file hints after stale docid misses (issue openclaw#113041) (openclaw#113515) test(doctor): align fast-path repair contracts (openclaw#119812) perf(agents): index subagent recovery ownership (openclaw#119793) fix(gateway): keep chat startup off catalog discovery (openclaw#119742) fix(test): keep TUI PTY suites in their owner lane (openclaw#119787) docs: correct dashboard auth precedence (openclaw#119785) docs: document control ui owner handoff fix: grant host-authorized control ui owner access fix(worktrees): preserve registered roots during orphan cleanup (openclaw#119709) fix(matrix): prevent shared client key collisions (openclaw#119667) fix(diagnostics-otel): propagate exported span context (openclaw#112283) fix(worker): isolate state observer failures (openclaw#117507) fix(qa): attest realized profile executions (openclaw#119761) fix(gateway): finish successful sessions after timestamp races (openclaw#119752) fix(agents): fence restart recovery lifecycle (openclaw#119776) fix(ui): preserve chat history and active run timing (openclaw#119729) improve(ollama): reduce inactive startup cost (openclaw#119745) improve(gateway): defer inactive plugin runtime imports (openclaw#119733) ...
Closes #119728
Related: #110771, #111854, #113980
AI-assisted: Codex was used to diagnose, implement, review, and verify this change. No agent transcript is included.
What Problem This Solves
Fixes an issue where users returning to an active Control UI session could lose otherwise-displayable chat history, reasoning, and tool activity behind
[chat.history omitted: message too large], while the working timer restarted from the navigation, reconnect, or reload time.Why This Change Was Made
The Gateway display projection now removes private
__openclaw.upstreamUserTextreconstruction metadata before applying the public history budget. The active-run snapshot also carries its authoritative start timestamp, and Control UI history/tool replay preserves that timestamp rather than substituting the recovery time.This is distinct from #111854 / #113980: those handle how genuinely oversized rows are presented after omission. This change prevents a normal visible row from being omitted solely because private metadata inflated the display payload.
The dependency boundary was checked directly against OpenAI Codex source at
4df8027a9703:codex-rs/protocol/src/models.rs:908-920,1252-1256defines internal message metadata and its removal boundary;codex-rs/core/src/client.rs:832-856,1180-1200clears that metadata before unsupported-provider delivery and metadata-insensitive request comparison.User Impact
Navigating away from, reconnecting to, or reloading an active session now restores the visible prompt, assistant progress/reasoning, running tool activity, stop control, and elapsed working time from the original run start. Completed reasoning, answer text, and tool call/result history also remain visible after switching sessions.
Release Note Context
Control UI: preserve chat history, reasoning/tool activity, and elapsed working time after session navigation, reconnect, or reload.
CHANGELOG.mdis intentionally unchanged for maintainer release preparation.Evidence
Direct Azure Crabbox proof
eastus2cbx_b0832085228b(released after proof)Standard_D32ads_v6, Ubuntu 26.04, 32 vCPU24.15.0, pnpm11.15.1, Playwright Chromium151.0.7922.34a3946d92206ba9780c52b7884cda13f528008d67b6634f07b0926566603eec20Gateway contract:
pnpm test \ src/gateway/chat-display-projection.test.ts \ src/gateway/chat-abort.test.ts \ src/gateway/server.chat.gateway-server-chat-b.test.tsResult: 3 files, 149 tests passed.
Active-turn Chromium recovery:
Result: 3 tests passed: SPA navigation, socket reconnect, and full reload. Downloaded screenshots show the prompt, progress text, running
Readtool, stop control, and original 10-minute elapsed time after navigation/reload.Completed history/reasoning/tool Chromium recovery:
OPENCLAW_UI_E2E_ARTIFACT_DIR=.artifacts/control-ui-e2e/azure-history-timer-proof/completed \ 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 \ -t "restores reasoning and tool activity after navigating away from a session"Result: 1 focused test passed. Downloaded screenshots and WebM show reasoning, answer text, and
Readtool activity before and after returning to the session.Artifact archive SHA-256:
2f5b91df6e284b60c3a2d653cc43b827935b4ec5005092d7e47dd001f986c1dd.Authoritative reconnect timer follow-up
e30965e5682e640156f8d0e8b1c07089e00740c4eastus2cbx_d170df591645(released after proof)Standard_D32ads_v6, Ubuntu 26.04, 32 vCPU24.15.0, pnpm11.15.1, Playwright Chromium151.0.7922.34OPENCLAW_CAPTURE_UI_PROOF=1 \ pnpm test ui/src/e2e/chat-active-turn-recovery.e2e.test.tsResult: 1 file, 3 tests passed. The reconnect snapshot uses an authoritative start time approximately 10 minutes old and asserts both the recovered elapsed component timestamp and visible
10mtext. The downloaded04-reconnect-after.pngvisibly shows the restored prompt, assistant progress, runningRead README.mdtool, stop control, and10m 1selapsed time after socket reconnect.5f845e3745d7d1f499452718d6aef09cb5c1924bbc926de9278b524842feae4769654c4efdfd035e109417dc4f15b6dca234871fda4b3e88786ae079940940cbOversized fallback budget follow-up
780edf8fa63fd96076c69afd7b602099eba7a291eastus2cbx_60235a01d92a(released after proof)Standard_D32ads_v6, Ubuntu 26.04, 32 vCPU24.15.0, pnpm11.15.1pnpm test \ src/gateway/chat-abort.test.ts \ ui/src/pages/chat/chat-history.inflight.test.tsResult: 2 files, 74 tests passed. The exact-boundary regression proves the former minimal
{ runId, text }fallback remains withinmaxBytes, omitsstartedAtwhen adding it would overflow, and retainsstartedAtwhen the fallback budget permits it.The Chromium proof was not repeated for this follow-up because the change only guards the optional timestamp in the oversized-snapshot fallback. Ordinary active-turn snapshots, including the captured reconnect case, still use the unchanged full-snapshot path.
Frozen-base final proof
20b2ee5e73aacb863f804d47e468902d072fa70e5ec4d9f82a6bf05edb3bf33558f10f84ec6d317eeastus2cbx_1284be0126ce(released after proof)Standard_D32ads_v6, Ubuntu 26.04, 32 vCPU24.15.0, pnpm11.15.1Results:
git diff --checkpassed.The downloaded reconnect screenshot visibly shows the restored prompt, assistant progress, running
Read README.mdtool, stop control, and10m 1selapsed time.ea8784d4408a4b3e9e1fb07092c1ba28f202226bdb38b296ac1b7d43e87d6b32f5a50de690ba4cc00846020aacbb9ea74bf0c46c30b45da3040339b8cdef4818Additional checks
check:changedpassed.autoreview --mode uncommitted: clean, no accepted/actionable findings; correctness confidence0.99.git diff --check: passed.Scope