Skip to content

fix: show recovery guidance for interrupted conversation startup - #168211

Open
RomneyDa wants to merge 19 commits into
mainfrom
fix/session-startup-recovery-ux
Open

RomneyDa wants to merge 19 commits into
mainfrom
fix/session-startup-recovery-ux

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Problem

Interrupted conversation startup showed raw harness/worktree failures without telling the user how to recover. Restoring history could lose the curated notice or expose a nested operator diagnostic.

Changes

  • Integrate main ba6d94ec17712, retaining current Toast, feedback, host-update, desktop-summary and failure-provenance owners; do not restore the retired inline banner or obsolete failed-edit actions.
  • Recognize the actual Codex missing-thread and managed-worktree lease-loss producer errors, including lease loss without optional details. Show concise recovery guidance with the existing expandable details and copy action.
  • For a missing saved conversation, explain that a new conversation is needed; never offer a retry into the same missing conversation or reuse the unrelated machine-update action. Messaging-channel replies retain the explicit /new recovery command.
  • Persist only a closed startup diagnostic category in chat history, not the formatted nested cause chain. Preserve existing notice metadata and idempotent projection. Raw errors remain in operator diagnostics.

Validation

  • Original startup cases, optional lease suffix, private nested cause, metadata/idempotence, lazy notice mount and wrong retry-action regressions reproduced before their corrections.
  • Focused real SQLite history, producer-copy and rendered notice tests pass. 291 core/history and 101 UI consumer cases pass; 55 producer/channel cases pass after the final channel-copy correction.
  • Seven actual bundled Control UI browser cases pass, including desktop/mobile layout, restored history and correct missing-conversation controls. Synthetic Gateway fixtures supply errors; this is not a live-provider claim.
  • Qualified core/UI type-aware lint, UI typecheck, controller guard, formatting and diff checks pass.
  • Personally inspected sibling Codex 092d3acd6bec, codex-rs/app-server/src/request_processors/thread_processor.rs:2870-2916, for the actual missing-thread errors. No protocol/dependency changes.

Current-head CI remains the broad gate. Fresh local review findings were addressed, including restoring the explicit channel recovery command (red before the correction, green afterward). A current live-provider/Gateway startup failure was not exercised; the bundled-browser proof uses synthetic error fixtures.

Visual evidence

The real bundled Control UI uses the same synthetic error fixture, light theme and 1280×900 viewport. Before: main ba6d94ec17712; after: 3afe1b1415901. Identical 1280×800 crops omit the unrelated model-selector footer. The clean comparison comes first; annotation copies explain the same frames.

Clean comparison

Before:
Before: raw startup failure

After:
After: actionable startup guidance

Annotated comparison

Before annotated: raw startup failure

After annotated: actionable startup guidance

Latest CI repair

The hosted commands test typecheck caught a branch-only startup fixture still passing a string to main’s options-object lifecycle helper. Updated the fixture and removed its shadowed local name. All 24 lifecycle cases and the exact commands test type graph pass; canonical type-aware lint, formatting and diff checks pass. New-head CI pending.

Four uploaded screenshot links and PR body readback are verified. The images were personally inspected before upload and delivered in chat. Hosted-page rendering could not be checked because the browser access host is unavailable.

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 10, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR adds consistent startup-failure explanations and recovery guidance while preserving redacted diagnostics in live chat, reopened history, and channel replies.

Example: A conversation fails with thread not loaded: synthetic-thread.

  • Before: The collapsed notice gives generic failure guidance.
  • After: The notice immediately explains that conversation context is unavailable and suggests recovery, with the diagnostic available under Details.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and source-consistent, with both earlier findings repaired; synthetic visual evidence and an unattributed exact-head typecheck failure limit confidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored presentation PR is outside the ordinary contributor proof gate; inspected screenshots demonstrate visible guidance, while production history tests support diagnostic preservation and live Telegram remains explicitly unrun.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Users see generic or implementation-heavy startup errors and must expand Details to discover recovery guidance.
Reason: The maintainer-authored direction restores the documented explanation-and-next-step contract through existing presentation surfaces.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Both prior P2 findings are resolved, and this maintainer-authored PR remains useful. No new actionable source defect was found; an exact-head typecheck failure still needs attribution.

Priority: P2
Reviewed head: ff495e20e41835fea0032f41fae5ee8aed6ce2e6

Before merge

  • Complete next step - Inspect the check-test-types-core-2 failure in CI run 38971383959 and determine whether it is caused by this diff or inherited from the base before landing.

Findings

None.

Tests

  • Missing end-to-end proof: Live channel delivery and an end-to-end runtime-to-reopened-browser scenario are not demonstrated; supplied screenshots use synthetic Gateway I/O, and the new history regressions have no recorded base-fail/head-pass comparison.
Agent review details

How this fits together

Agent lifecycle failures enter shared presentation logic, then flow through Gateway events, persisted transcript reports, session summaries, Control UI notices, and external-channel replies.

flowchart TD
  A[Agent startup failure] --> B[Shared failure presentation]
  B --> C[Gateway live events]
  B --> D[Transcript report]
  D --> E[History display projection]
  C --> F[Control UI notices]
  E --> F
  B --> G[Channel reply]
Loading

Technical review

Best possible solution:

Land the shared presentation repair once the failed exact-head typecheck is classified and applicable gates are satisfied.

Do we have a high-confidence way to reproduce the issue?

Current-main fallbacks and the inspected before screenshot establish the presentation defect; this read-only review ran no reproduction.

Is this the best way to solve the issue?

The shared presentation helper fits the existing owners, preserves diagnostic access, and leaves retry, replay, thread recovery, and lease authority unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against cd57bc91d991.

Provenance checked

  • Lifecycle error presentation keeps the original intent (5620ea7: Canonical terminal events preserve outcome facts and protect error privacy; startup presentation retains those boundaries.)
  • Certified report details keeps the original intent (3b2c61d: Expose curated contention guidance while keeping private report fields out of display history; the extension narrowly admits matching redacted startup diagnostics.)
  • Canonical terminal failure notices keeps the original intent (b957f1a: Only settled terminal failures produce durable notices; this PR changes their presentation without promoting failed attempts or automatically replaying requests.)
  • Compact failed-reply presentation keeps the original intent (f5028d0: Keep concise visible copy and expandable diagnostics while preserving guarded retry and drafts; startup-specific explanations retain that structure.)
  • Shared failure-copy ownership keeps the original intent (6dc77a3: Prevent parallel failure-copy stacks from disagreeing; the browser-safe helper is shared across the affected presentation consumers.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced changes and prior findings: The pinned introduced diff adds matching startup-diagnostic preservation and channel-specific recovery destinations, resolving both recorded prior findings. (src/gateway/chat-display-projection.helpers.ts:268, ff495e20e418)
  • Production history boundary: The projector requires the recognized diagnostic and matching curated report content, redacts and bounds the diagnostic, and updates the canonical failure envelope; new persisted page-kernel cases cover both startup failures and credential exclusion. (src/gateway/server-methods/chat-history-pages.recovery.test.ts:115, ff495e20e418)
  • Inspected visual evidence: All three prepared screenshots were inspected: the before image has generic collapsed copy, while both after images expose specific recovery guidance outside Details; the PR identifies these as earlier-revision synthetic browser captures.
  • Current main still needs the presentation repair: Fetched main retains the generic persisted-report fallback without the new startup presentation; its existing notice and storage-copy work does not supply this classification. (src/sessions/session-run-error.ts:43, cd57bc91d991)
  • No-migration storage case: The existing custom report contract accepts optional opaque details and serializes them into the existing event envelope; this PR adds an optional diagnostic without changing schemas, rewriting existing records, or requiring it when reading older reports. (src/config/sessions/session-accessor.sqlite-transcript-reports.types.ts:26, ff495e20e418)
  • Exact-head CI failure remains unattributed: The check-test-types-core-2 job failed on the reviewed head; its annotation contains only exit code 2. Log retrieval redirected to a blocked Azure Blob host, preventing attribution. Other checks and openclaw/ci-gate were still pending. (ff495e20e418)

PR surface

Source +155, Tests +409, Other +2. Total +566 across 27 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 14 202 47 +155
Tests 12 412 3 +409
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 27 616 50 +566

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This improves recovery guidance for existing-conversation failures without establishing an urgent runtime outage or first-run lockout.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-10T05:12:50.994Z sha 7e9dbab :: needs changes before merge. :: [P2] Preserve startup diagnostics through history display projection | [P2] Name an actionable recovery destination in channel replies
  • reviewed 2026-10-10T05:32:14.379Z sha ebd94db :: needs changes before merge. :: [P2] Preserve startup diagnostics through history display projection | [P2] Name an actionable recovery destination in channel replies
  • reviewed 2026-10-10T05:56:26.092Z sha ebd94db :: needs changes before merge. :: [P2] Preserve startup diagnostics through history display projection | [P2] Name an actionable recovery destination in channel replies

Reviewed October 16, 2026, 5:54 PM ET / 21:54 UTC (Revision 4).

@RomneyDa
RomneyDa marked this pull request as ready for review October 10, 2026 05:25
@RomneyDa
RomneyDa force-pushed the fix/session-startup-recovery-ux branch from ebd94db to 2f0bbff Compare October 16, 2026 02:41
@RomneyDa
RomneyDa force-pushed the fix/session-startup-recovery-ux branch from 2f0bbff to ff495e2 Compare October 16, 2026 21:44
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 16, 2026
@RomneyDa

RomneyDa commented Oct 16, 2026 •

Copy link
Copy Markdown
Member Author

Review follow-up for e0d2eba90b2a4aef34f00cfb22b5082d49621a62:

ClawSweeper’s completed review of the production-identical ff495e20e418 confirms both P2 findings are resolved and identifies no new source findings. Its remaining CI attribution item is resolved: check-test-types-core-2 reported TS2339 for direct property access on unknown messages in the new history test. Test-only commit e0d2eba90b2a replaces those accesses with equivalent property matchers. The affected test-type graph, both regression cases, and targeted lint pass locally.

Exact-head CI is now successful (71 jobs passed, 22 skipped), and the required openclaw/ci-gate is green. No failed or pending checks remain. The PR body records the current proof and the explicitly unrun live Telegram check. No merge requested or performed.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant