Skip to content

feat(ui): archive and delete sessions while the Gateway reconnects - #182292

Merged
steipete merged 10 commits into
mainfrom
steipete/offline-archive-delete
Oct 24, 2026
Merged

steipete merged 10 commits into
mainfrom
steipete/offline-archive-delete

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Archive, unarchive, and delete were unavailable while the same Gateway connection recovered. This PR lets users queue those actions alongside offline renames and reactions (#177558).

The startup-size repair then put optimistic session previews behind the optional mutation chunk. A cold rename could increment the queued count while leaving the old title visible. This repair restores the synchronous presentation contract without changing any budget.

Solution

The existing application Gateway outbox remains the only queue. Admission captures the session incarnation and recovery scope synchronously. Archive, restore, and delete share one lifecycle slot and retain its FIFO position; the newest choice wins. Deleting a session retires its unsent metadata and reaction intents.

Preview tokens, row movement/hiding, title changes, queued counts, and predecessor-preview release remain eager and data-only. Replacing a queued delete with an archive immediately restores and projects the retained row. Network replay, receipts, failure handling, delete absence confirmation, creation work, and post-write refresh/warning handling stay in the optional mutation runtime. Replay revalidates the captured connection before sending requests. The asynchronous preview-initialization machinery was removed. Direct patch execution and its refresh helpers now share the lazy runtime; the eager owner keeps only captured targets and projection claims. Receipt subscriptions are admitted synchronously, and execution reads the target again after acknowledgement because the receipt can bind a previously unbound session.

The Gateway still checks permissions and session identity. Archive-only deletion replays a superseded archive prerequisite in the same slot. Missing deletion identities produce a batch error while valid selections queue. Confirmations, personal pins, Undo ownership, generation fences, and preserved-worktree handling retain their existing contracts. Rejected changes restore the appropriate projection; already-gone deletion succeeds only after authoritative absence confirmation.

The completed CI run also exposed two browser issues: failure-attention presentation ignored suppressErrorNotice, and a workspace-retry assertion matched both the Details panel and the composer banner. The shared attention owner now honors suppression; the assertion targets its existing Details panel. The global suppressed-error assertion remains unchanged.

Evidence

  • Focused owner, outbox, chat/settings/read, lifecycle, creation, and session/chat browser-component suites: 636 tests across 40 files, using pnpm test <files> --maxWorkers=1 (592 normal including receipt ownership, 21 isolated read-marker, 23 browser-component tests).
  • Final bundled browser proof: 51 tests across 8 files passed, covering terminal-error suppression, placement/retry, login, offline rename/reconnect, archive, Undo, delete, and offline title behavior.
  • Local native performance comparison against a6ce7b060cff0a862a3222b25d47c02776d3de3f: 281,114 B startup gzip / 281,809 B limit (695 B headroom; 7 requests). Chat boot 1,275,591 B / 1,275,713 B limit (122 B headroom; 19 requests). All checked budgets passed under Node v26.12.1; no limits changed.
  • pnpm tsgo:ui, scoped oxlint, oxfmt --check, and git diff --check: passing.
  • Independent Codex review through P2: scoped-clean, with no accepted/actionable findings after fixing and proving the ACK-bound receipt-fact issue.

All nine reported failures retain their assertions. Network expectations await the existing lazy-load seam, while optimistic assertions execute synchronously. The settings-error fixture now supplies IndexedDB for the authenticated pane's durable-draft restoration. A receipt regression also covers a failed predecessor followed by a successful unbound write, failed roster readback, and later stale roster publication. Codex review identified the missing fact capture for a target first bound by its ACK; the stale roster assertion reproduced the reversal before the correction and passes with it. New synchronous rename/archive/delete and coalescing assertions failed on the original head; the suppressed failed/timeout attention assertions failed before their owner fix.

The repair removes the async preview initializer and the now-unused row-projection runtime export. Production delta for this repair is +460/-417 lines, predominantly moving existing execution behind the lazy boundary; the full PR is +1559/-676 production lines and +1776/-258 test lines against its merge base.

No budgets, baselines, timeouts, snapshots, or failure exclusions changed. This repair used synthetic fixtures and did not operate a live Gateway or live state. Exact-head hosted CI remains separate from local proof.

Earlier live evidence

Earlier branch work exercised real Chromium against an isolated Gateway behind a TCP fault proxy. The session menu/organizer chunks were loaded while online. Offline actions updated the UI immediately, drained after reconnection, and remained committed after reload. These retained captures are synthetic; they are earlier-branch live evidence, not a new live run for this repair.

Offline delete: row gone and one queued change

Offline archive: archived banner and two queued changes

The earlier live run also identified a separate service-worker precache gap for menu chunks not loaded before going offline. This repair removes the mutation-runtime dependency from optimistic admission; it does not change that precache owner. The queue remains memory-only, as documented in docs/web/control-ui/offline-and-reconnect.md.

Queue archive, unarchive, and delete through the existing Gateway deferred-intent owner during same-identity recovery. Coalesce lifecycle choices in place and discard superseded metadata and reactions before hiding a deleted row.

Reuse session-owned optimistic rows, confirmation dialogs, durable identity guards, and chat transitions. Roll back rejected or discarded work, confirm already-missing deletes, and retire old in-flight receipts when their connection owner changes.

Keep placement, pinning, sharing, and other consequential operations connection-gated. Load preserved-worktree notices only when needed, document the memory-only queue, and regenerate the boot manifest.
@clawsweeper

clawsweeper Bot commented Oct 24, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T11:58:55.883779Z b052f19 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Oct 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a172a389af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR queues session archive, unarchive, and delete actions while the Gateway reconnects.

Example: Archive agent:main:notes while reconnecting.

  • Before: Archive is disabled until the connection returns.
  • After: The session leaves the active list immediately and the queued archive runs after reconnecting.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful live-tested feature with a coherent final CI repair, an unresolved Undo defect, and incomplete destructive-authority evidence.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Session cleanup controls become unavailable while the Gateway reconnects.
Reason: The maintainer-directed feature extends an established offline workflow without adding configuration or persistent queue state.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: the final CI repair is coherent, but the previously reported shared-pin Undo defect remains unresolved.

Priority: P2
Reviewed head: 8d4349d6184de31c8dbb88c75e39ae88e67c5215

Before merge

  • Add real behavior proof - Authority-chain proof required: inspected screenshots and the isolated-Gateway Chromium report establish allowed offline archive/delete, reconnect drain, and persistence after reload, but no supplied production-path trace shows revoked access or reassigned ownership rejecting queued mutations before session, transcript, and cleanup effects; provide those cases with credentials, IPs, and non-public endpoints redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Restore captured shared pins after deferred Undo (P2) - This previously reported finding remains unresolved. Archive a shared-pinned session, let archive commit while another intent keeps the queue draining, then click Undo. The Gateway clears pinnedAt during archive, but this branch sends only archived:false and returns before either online repin path. The session returns permanently unpinned despite Undo having captured pinned:true. Retain that shared-pin receipt and restore it after confirmed unarchive under current authority, covering single and bulk Undo.
  • Resolve security review attention item - Source retains server-owned authorization checks; no concrete bypass was found, but destructive replay authority remains unproven.
  • Explain or restore the original intent of Shared-pin restoration during Undo - d0b4640: Undo restores captured shared pins after unarchive; the deferred branch bypasses both restoration paths without explaining the loss.

Findings

  • [P2] Restore captured shared pins after deferred Undo — ui/src/components/session-organizer-archive.runtime.ts:499-505

Provenance

  • Shared-pin restoration during Undo changes intended behavior without addressing why it exists (d0b4640: Undo restores captured shared pins after unarchive; the deferred branch bypasses both restoration paths without explaining the loss.)

Tests

  • Low-value test ui/src/components/session-organizer-archive.test.ts: Replace the offline bulk Undo test that asserts mocked patch shapes without completing replay; it pins the omission of shared-pin restoration instead of verifying restored state.
  • Missing end-to-end proof: Supply final-effect rejection proof for revoked or reassigned session access and a red/green regression covering shared-pin restoration during deferred single and bulk Undo.
Agent review details

How this fits together

Control UI actions enter the existing deferred-intent owner, replay through Gateway session handlers, and reconcile optimistic session rows with server results.

flowchart TD
 A[Session menus and Sessions page] --> B[Session access checks]
 B --> C[Deferred intent owner]
 C --> D[Session mutation owner]
 D --> E[Gateway authorization and lifecycle]
 E --> F[Session and transcript storage]
 D --> G[Optimistic rows and Undo]
Loading

Technical review

Best possible solution:

Keep the existing queue and mutation owners, restoring captured shared pins after deferred Undo succeeds under current authority.

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

Current-main source confirms connection-gated lifecycle actions, and the introduced deferred Undo branch omits shared-pin restoration; no target code was executed.

Is this the best way to solve the issue?

Extending the existing deferred owner is appropriate, and lazy runtime extraction addresses the measured boot constraint, but Undo must preserve its existing restoration contract.

Full review comments:

  • [P2] Restore captured shared pins after deferred Undo — ui/src/components/session-organizer-archive.runtime.ts:499-505
    This previously reported finding remains unresolved. Archive a shared-pinned session, let archive commit while another intent keeps the queue draining, then click Undo. The Gateway clears pinnedAt during archive, but this branch sends only archived:false and returns before either online repin path. The session returns permanently unpinned despite Undo having captured pinned:true. Retain that shared-pin receipt and restore it after confirmed unarchive under current authority, covering single and bulk Undo.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Deferred lifecycle admission and coalescing changes intended behavior with a stated reason (e75403f: The existing queue handles same-identity metadata and reactions; this PR explicitly extends it with stable-position lifecycle coalescing.)
  • Optimistic deletion ownership keeps the original intent (09be104: Hide the full selection immediately, fence stale generations, and restore only owned rows on failure.)
  • Personal archive pins keeps the original intent (5e2f560: Only explicit Undo restores captured personal navigation pins, subject to current-profile and newer-intent checks.)
  • Confirmed results across reconnect keeps the original intent (64776a0: Preserve confirmed outcomes separately from reconciliation failures under verified connection ownership.)
  • Nested archive confirmation keeps the original intent (86380bb: Require an explicit choice before archiving parents whose nested sessions may move to the top level.)

Testing

Proof path: shipped entry point.

Security

Needs attention: Source retains server-owned authorization checks; no concrete bypass was found, but destructive replay authority remains unproven.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e75403f adds ui/src/app/gateway-store.deferred-intents.ts:145 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e75403f38e69; files: ui/src/app/gateway-store.deferred-intents.ts)
  • Vyctor H. Brzezowski: Raw commit 5e2f560 adds ui/src/components/session-organizer-archive.runtime.ts:390 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5e2f560194b1; files: ui/src/components/session-organizer-archive.runtime.ts)

PR surface

Source +824, Tests +1455, Docs +15. Total +2294 across 66 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 37 1313 489 +824
Tests 28 1587 132 +1455
Docs 1 23 8 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 66 2923 629 +2294

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Useful session-management capability with a limited, source-reproducible Undo defect.
  • merge-risk: 🚨 session-state: Deferred Undo can restore a session while losing its captured shared pin.
  • merge-risk: 🚨 security-boundary: Queued destructive intent outlives initial admission; final-effect authority evidence remains outstanding.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add final-effect proof that revoked session access and reassigned ownership reject queued archive/delete before destructive I/O.

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 (2 earlier review cycles)
  • reviewed 2026-10-24T06:24:36.175Z sha a172a38 :: needs real behavior proof before merge. :: [P2] Preserve archive-only authority when coalescing deletion | [P2] Report deferred deletions rejected for missing session identity | [P2] Restore captured shared pins after deferred Undo
  • reviewed 2026-10-24T10:37:22.178Z sha cadb930 :: needs real behavior proof before merge. :: [P2] Restore captured shared pins after deferred Undo

Reviewed October 24, 2026, 7:06 AM ET / 11:06 UTC (Revision 3).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22bfe424ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe4424d528

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete

Copy link
Copy Markdown
Contributor Author

Live integration proof

Current main (5e0b786) merged locally with #182334 (send reconciliation), #182292 (offline archive/delete) and #182336 (deferred-chunk precache), plus #182336's sidecar-race fix. One full build on Node 26.12.1, served by an isolated Gateway behind a TCP fault proxy, and driven by real headless Chromium with fresh browser contexts and nothing pre-warmed.

Scenario Result
Lost send (full black hole, then link down) "Waiting for reconnect", then sent automatically after reconnect; exactly 1 row after reload
Lost ACK (Gateway received it, reply lost, then link down) "Waiting for reconnect", then sent after reconnect; exactly 1 row after reload (no duplicate turn)
Dead link with a pending send detected after 35s; delivered automatically when the link returned (no Retry)
Idle dead link detected after 30s
Offline delete and archive from the session menu (cold, no warmed chunks) rows applied immediately ("1 queued", then "2 queued"); drained on reconnect; persisted after reload
Deferred precache 752 cache entries after background precache; 5 never-visited routes opened offline with 0 chunk failures
Offline rename / reaction applied with "1 queued"; persisted after reload
Blip, offline send queue, flaky link (600ms latency, 900ms jitter, 4% resets), offline reload via SW pass (flaky: 5/5 delivered)

No "Delivery unconfirmed" state appeared in any scenario.

Move offline previews, replay, archive projections, and mutation receipt work into the session interaction runtime. Keep native queue admission and durable delete identity capture synchronous, and prepare optional code before RPC dispatch so a failed download cannot misreport a committed mutation.

Isolate the runtime and its receipt/copy dependencies from captured route chunks. Budgets and baselines are unchanged.

Validation: paired main comparison passes; matched local startup gzip drops from 281214 to 280929 bytes, leaving 880 bytes under the 281809-byte enforced limit. Main comparator is 280590 bytes. All 331 focused behavioral tests and six chunking tests pass, including a red-to-green indirect boot-dependency regression. UI typecheck, scoped oxfmt check, git diff check, and independent review pass.
Move session creation requests and receipt handling into the optional mutation
runtime. Keep connection capture, error publication, model overrides, prepared
work-session placement, and reconciliation with their existing owners. Recheck
the captured connection and abort signal before dispatch after a cold import.

Keep the creation helper in the mutation chunk so captured boot groups cannot
pull it back into startup. Extend cold-disconnect and chunk-isolation coverage,
and wait for real request dispatch in the background creation tests.

Paired local performance: startup gzip 280421 B versus main 280590 B and the
unchanged 281809 B enforcement limit. The original branch measured 281214 B
with the same local toolchain. Focused tests: 70 plus 30 passed. UI typecheck,
scoped oxfmt check, and git diff --check passed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dff6d12813

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The Undo replay and offline Sessions-page repairs are pushed, the review thread is resolved, and main conflicts are repaired in cadb930. The PR body now records the final frozen-dependency browser proof and distinguishes pending exact-head CI/performance from prior-head evidence.

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 24, 2026
@steipete
steipete enabled auto-merge (squash) October 24, 2026 10:41
@steipete
steipete disabled auto-merge October 24, 2026 10:44
@steipete

Copy link
Copy Markdown
Contributor Author

Final repair acceptance: preserve the existing startup and route-boot byte/request budgets, measured by pnpm ui:check-performance:base a6ce7b060cff0a862a3222b25d47c02776d3de3f using one installed toolchain. Current-head CI measured startup 281,647 B (passes) and chat boot 1,279,877 B against a 1,275,713 B limit; paired main chat boot is 1,275,594 B. This is a branch-caused failure, not an inherited exception.

The repair removes the eager header import and stops grouping shared session copy with the mutation runtime. Mutation execution retains its existing lazy action owner. A production-browser regression withholding that runtime fails initial roster readiness before the repair. The other CI failures share a missing sidebar host method: spreading a class instance lost the prototype method and suppressed archive success/Undo after the write. Explicit delegation fixes the exact unit regression without changing its assertions; all 102 affected owner/sidebar tests pass. Final paired-build and affected browser proof are in progress; no CI rerun, timeout, assertion, or budget change is used.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Final CI repair is pushed as 8d4349d. The body records archive host delegation, lazy mutation loading, red/green regressions, 45 passing affected browser scenarios, and the passing paired build measurement with unchanged budgets. Current-head hosted CI remains pending.

@clawsweeper

clawsweeper Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Landing stopped at the authorized repair-round limit. Current head: 8d4349d. Exact-head run 40088243668 passes control-ui-performance, but all three UI shards fail nine tests. All three failed job logs were fetched once; these are treated as branch-caused, not inherited or diagnosed flakes, and no CI rerun or further repair push is being used.

Remaining failures:

  • chat-pane.read-marker.test.ts: optimistic read rollback during restart, expected one patch call, observed zero.
  • chat-pane-settings-receipt-errors.test.ts: current queued settings owner, expected one patch call, observed zero.
  • chat-pane-settings-publication.test.ts: unrelated confirmed publication, expected one patch call, observed zero.
  • chat-pane-session-settings-materialization.test.ts: queued settings for absent materialization/preceding write, expected one patch call, observed zero.
  • chat-pane-unmaterialized-settings.test.ts: absent thinking intent (return=false), expected one patch call, observed zero.
  • chat-pane-settings-ownership.test.ts: older direct patch rejection, expected two patch calls, observed zero.
  • chat-pane-settings-error-ownership.test.ts: latest queued failure intent (confirmed), expected one patch call, observed zero.
  • chat-pane-read-admission.test.ts: newer visible activity, expected one acknowledgement, observed zero.
  • chat-pane-offline-metadata.test.ts: header rename and reaction, queued count reaches one while the row still has its original label.

Source inspection points to cold mutation initialization: patchNow waits for projectSessionPatchRowFields before dispatch/optimistic setup, and deferred admission publishes its queue entry before asynchronous runtime preparation installs the preview. The final removal of eager header loading exposes these timing assumptions. This has not been repaired or relabeled as main-owned.

Completed proof remains valid for its scope: 214 focused owner/creation/header tests, 45 affected production-browser scenarios, source/affected test types, lint/format, fresh Codex review through P2, and the paired local size check. The prior auto-merge request was retired through native recovery; preserve outcome 1cf34d186b309e8ee942f0b61484c101b4ec5262 and the retained review checkout for continuation.

Final remote verification: PR OPEN at the stated head, autoMergeRequest null, mergeCommit null. Source checkout clean on pr-182292-prep. Native reconciliation exited without submitting a replacement; it reports head drift from the retained cancelled attempt, and released its operation lock. Several browser CI shards were still running at the stop.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b052f1958c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +499 to +501
rows.map(async (session) => {
const receipt = Promise.withResolvers<boolean>();
const result = await patchSession(host, session, { archived: false }, scope, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore shared pins after deferred Undo is confirmed

If a previously shared-pinned session's queued archive is already in flight when Undo is clicked, this branch queues only { archived: false } and never uses the captured pinned value. The Gateway's archive handler clears pinnedAt, whereas unarchiving does not restore it (src/gateway/sessions-patch-lifecycle-flags.ts), so both requests can succeed while Undo permanently loses the original shared pin. The online branches below explicitly restore those pins, but this early return bypasses them. Keep pin writes unavailable while offline if necessary, but restore eligible captured shared pins after the deferred unarchive is confirmed.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 895608e into main Oct 24, 2026
110 of 113 checks passed
@steipete
steipete deleted the steipete/offline-archive-delete branch October 24, 2026 12:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
…penclaw#182292)

* feat(ui): support offline session archive and delete

Queue archive, unarchive, and delete through the existing Gateway deferred-intent owner during same-identity recovery. Coalesce lifecycle choices in place and discard superseded metadata and reactions before hiding a deleted row.

Reuse session-owned optimistic rows, confirmation dialogs, durable identity guards, and chat transitions. Roll back rejected or discarded work, confirm already-missing deletes, and retire old in-flight receipts when their connection owner changes.

Keep placement, pinning, sharing, and other consequential operations connection-gated. Load preserved-worktree notices only when needed, document the memory-only queue, and regenerate the boot manifest.

* fix(ui): preserve offline lifecycle controls and startup budget

* fix(ui): defer deletion runtime and retain offline archive undo

* fix(ui): preserve offline deletion prerequisites and local pins

* perf(ui): lazy-load session mutation operations

Move offline previews, replay, archive projections, and mutation receipt work into the session interaction runtime. Keep native queue admission and durable delete identity capture synchronous, and prepare optional code before RPC dispatch so a failed download cannot misreport a committed mutation.

Isolate the runtime and its receipt/copy dependencies from captured route chunks. Budgets and baselines are unchanged.

Validation: paired main comparison passes; matched local startup gzip drops from 281214 to 280929 bytes, leaving 880 bytes under the 281809-byte enforced limit. Main comparator is 280590 bytes. All 331 focused behavioral tests and six chunking tests pass, including a red-to-green indirect boot-dependency regression. UI typecheck, scoped oxfmt check, git diff check, and independent review pass.

* perf(ui): defer session creation outside startup

Move session creation requests and receipt handling into the optional mutation
runtime. Keep connection capture, error publication, model overrides, prepared
work-session placement, and reconciliation with their existing owners. Recheck
the captured connection and abort signal before dispatch after a cold import.

Keep the creation helper in the mutation chunk so captured boot groups cannot
pull it back into startup. Extend cold-disconnect and chunk-isolation coverage,
and wait for real request dispatch in the background creation tests.

Paired local performance: startup gzip 280421 B versus main 280590 B and the
unchanged 281809 B enforcement limit. The original branch measured 281214 B
with the same local toolchain. Focused tests: 70 plus 30 passed. UI typecheck,
scoped oxfmt check, and git diff --check passed.

* fix(ui): retain offline undo receipts and admit session page actions

* fix(ui): preserve archive hosts and defer mutation loading

* fix(ui): keep offline session previews synchronous
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:intake:feature Preliminary submission classification; full source review pending. docs Improvements or additions to documentation merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant