Skip to content

fix: archived chat composer returns after session navigation - #122641

Merged
jalehman merged 6 commits into
mainfrom
fix/archive-session-banner-reversion
Aug 12, 2026
Merged

jalehman merged 6 commits into
mainfrom
fix/archive-session-banner-reversion

Conversation

@jalehman

@jalehman jalehman commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users who archived the selected Control UI chat could see the active composer return after a delayed session refresh or after navigating away and back, even though the Gateway kept the session archived.

Why This Change Was Made

The session capability records confirmed archive state independently of roster-row lifetime and reapplies it to stale list projections. The reconciler remains the freshness authority: rejected stale events cannot update the overlay, explicit unarchive events clear it, and replacement session identities retire it. Presentation metadata remains gated on a known matching sessionId.

User Impact

Archived chats continue to show the archived-session notice and keep the composer disabled across refreshes and session navigation. Unarchiving or replacing the session restores the active projection normally, and replacement sessions do not inherit an earlier session's title or message preview.

Evidence

  • AI-assisted implementation and review.
  • Live verification reproduced the original reversion and confirmed that archive state persists after navigating to another session.
  • ClawSweeper P1 addressed: both changed-event paths update archive state only when reconciliation accepts the event. A newer unarchive followed by a stale archive event stays unarchived.
  • ClawSweeper P2 addressed: presentation metadata is preserved only when both rows have the same known sessionId. A partial prior row followed by a replacement identity cannot transfer its title or preview.
  • P1 autoreview follow-up addressed: confirmed archive state uses the patch response's authoritative sessionId and retires on an identity mismatch, so a replacement session cannot inherit the old archive state.
  • CI failure reproduced locally: session-management.groups.e2e.test.ts expected a stale active-list row to restore the archived row. The scenario asserts that the confirmed archive leaves the Active view while retaining its separate selection-order coverage.
  • pnpm --dir ui exec vitest run --config vitest.config.ts src/lib/sessions/index.test.ts src/lib/sessions/list-options.test.ts src/lib/sessions/reconcile.test.ts: 67 tests passed on head bfcd8f7ac22.
  • pnpm test:ui:e2e ui/src/e2e/session-management.archive.e2e.test.ts ui/src/e2e/session-management.groups.e2e.test.ts: 20 tests passed on head bfcd8f7ac22.
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs: passed on head bfcd8f7ac22.
  • P2 autoreview reported no accepted or actionable findings after the identity-gating fix.
  • Production delta: +99/-9 (net +90). Tests and test support: +327/-10 (net +317). The production growth owns confirmed archive state at the session capability boundary across roster eviction, event ordering, session identity replacement, deletion, and connection retirement. The presentation-metadata helper has no production delta from main.
  • Screenshots are not attached because this is a transient state-reconciliation defect rather than a visual styling change. The browser regression exercises the archive, navigation, stale refresh, and return sequence.

@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@jalehman
jalehman marked this pull request as ready for review August 12, 2026 14:04
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 12, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 12, 2026, 4:06 PM ET / 20:06 UTC.

ClawSweeper review

What this changes

This PR adds a Control UI archive-state overlay so an archived chat remains disabled across stale session refreshes and navigation.

Merge readiness

⛔ Blocked by patch quality or review findings - 6 items remain

Keep open: the new confirmed-archive overlay is not retired when a Gateway delete event removes the session, so stale archive state can survive a remote deletion and be reapplied to a later same-key projection.

Priority: P1
Reviewed head: 71d5355f7b09a9899538686731963f4514db505f

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has relevant browser and reconciliation coverage, but the unresolved deletion lifecycle is a merge-blocking session-state defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer PR has focused browser E2E coverage and reported live verification; the external-contributor proof gate does not apply.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer PR has focused browser E2E coverage and reported live verification; the external-contributor proof gate does not apply.
Evidence reviewed 5 items Changed overlay retains a fact beyond roster rows: The PR adds confirmed archive state and reapplies it to every decorated roster, while direct delete methods clear that state.
Gateway delete event has no archive projection: After deletion, the Gateway emits only the key, owner, and delete reason; the event broadcaster loads no session row once it is gone, so there is no archived value for the new observer call to clear the overlay.
Delete reconciliation omits overlay retirement: The new reconciliation helper forwards a null archive value to observeArchiveState, while both direct and subscribed delete branches retire only the pull-request summary.
Findings 1 actionable finding [P1] Retire archive state on Gateway delete events
Security None None.

How this fits together

The Control UI reconciles Gateway session lists and events into a roster that drives the selected chat and composer. The patch retains a confirmed archive fact outside roster rows so an evicted archived row cannot be reintroduced as active by stale data.

flowchart LR
  A[Gateway session list and events] --> B[Session reconciler]
  C[Archive or unarchive action] --> D[Confirmed archive overlay]
  B --> E[Session roster]
  D --> E
  E --> F[Selected chat]
  F --> G[Composer state]
Loading

Before merge

  • Retire archive state on Gateway delete events (P1) - A remote delete has no archived field after the Gateway removes its row, so this observer call leaves confirmedArchives intact. Unlike local deletion, a later same-key row without an identity can be forced archived; clear the map for reconciled.deletedKey and cover that event sequence.
  • Resolve merge risk (P1) - A Gateway-driven delete leaves the confirmed archive map populated; a reused key can inherit archive presentation before a new identity is available, and remotely deleted archived keys accumulate for the connection lifetime.
  • Resolve merge risk (P1) - Production changes are +103/-9 (net +94); retaining a confirmed fact outside an evicted roster row needs owner-boundary state, but all terminal event paths must retire it.
  • Complete next step (P2) - The required correction is concrete, but the maintainer-protected PR should remain in its existing human review path.
  • Improve patch quality - Clear the archive overlay on Gateway delete reconciliation.
  • Improve patch quality - Add a regression for remote deletion followed by a same-key projection without a session identity.

Findings

  • [P1] Retire archive state on Gateway delete events — ui/src/lib/sessions/index.ts:299-300
Agent review details

Security

None.

PR surface

Source +101, Tests +325. Total +426 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 111 10 +101
Tests 5 334 9 +325
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 445 19 +426

Review metrics

Metric Value Why it matters
Production vs test delta production +103/-9 (net +94); tests +334/-9 (net +325); test support +8/-1 (net +7) The patch introduces a connection-lifetime session-state owner, so lifecycle cleanup is material to merge safety.

Stored data model

Persistent data-model change detected: migration/backfill/repair: ui/src/e2e/session-management.groups.e2e.test.ts, serialized state: ui/src/e2e/session-management.archive.e2e.test.ts, serialized state: ui/src/e2e/session-management.groups.e2e.test.ts, serialized state: ui/src/lib/sessions/index.test.ts, serialized state: ui/src/lib/sessions/index.ts, serialized state: ui/src/lib/sessions/list-options.test.ts, and 7 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retire archive facts on deletion (recommended)
    Clear the overlay from the shared delete-reconciliation path and add a regression that proves a remotely deleted session cannot archive a later same-key projection.
  2. Pause the PR
    Pause if the overlay cannot be made lifecycle-complete without a broader session-state design decision.

Technical review

Best possible solution:

Clear confirmed archive state whenever reconciliation reports a deleted key, cover a remote delete followed by an id-less same-key projection, then retain the overlay as the canonical fix for stale refreshes.

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

Yes, from source: a Gateway delete has no archive field, and the new event reconciliation path never clears the confirmed archive map for its deleted key.

Is this the best way to solve the issue?

No—not yet. Keeping confirmed archive state at the session-capability boundary is the right shape, but its Gateway delete lifecycle is incomplete.

Full review comments:

  • [P1] Retire archive state on Gateway delete events — ui/src/lib/sessions/index.ts:299-300
    A remote delete has no archived field after the Gateway removes its row, so this observer call leaves confirmedArchives intact. Unlike local deletion, a later same-key row without an identity can be forced archived; clear the map for reconciled.deletedKey and cover that event sequence.
    Confidence: 0.94

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3edc9c2be5ff.

Labels

Label changes:

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

Label justifications:

  • P1: A normal archived-chat workflow can show a disabled composer for a later session after remote deletion and key reuse.
  • merge-risk: 🚨 session-state: The PR adds an out-of-roster archive fact whose deletion and replacement lifecycle determines visible session state.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer PR has focused browser E2E coverage and reported live verification; the external-contributor proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • jalehman: Authored the merged archive-transition repair and the current PR, so has prior merged ownership of this session-state path. (role: recent archive-flow contributor; confidence: high; commits: 2ae316e2f33d; files: ui/src/lib/sessions/index.ts)
  • Vyctor H. Brzezowski: Authored the merged immediate pin/unpin overlay repair in the same session mutation owner. (role: adjacent session-overlay contributor; confidence: medium; commits: 1512dd88cb81; files: ui/src/lib/sessions/session-mutations.ts)
  • wanyongstar: Current-main blame attributes the surrounding row-decoration boundary to this contributor. (role: recent current-main contributor; confidence: medium; commits: 7e215338414c; files: ui/src/lib/sessions/index.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-12T14:11:07.354Z sha 705aa47 :: found issues before merge. :: [P1] Ignore stale archive events before updating the overlay
  • reviewed 2026-08-12T15:11:16.352Z sha 64fdb0a :: found issues before merge. :: [P2] Keep presentation metadata gated on known session identity
  • reviewed 2026-08-12T17:02:43.659Z sha bfcd8f7 :: needs changes before merge. :: [P1] Require an exact session identity before reapplying archives

@jalehman
jalehman force-pushed the fix/archive-session-banner-reversion branch from 705aa47 to 64fdb0a Compare August 12, 2026 14:34
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 12, 2026
@jalehman
jalehman force-pushed the fix/archive-session-banner-reversion branch from bfcd8f7 to 71d5355 Compare August 12, 2026 19:42
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 12, 2026
@jalehman
jalehman merged commit c631b1a into main Aug 12, 2026
101 checks passed
@jalehman
jalehman deleted the fix/archive-session-banner-reversion branch August 12, 2026 20:10
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 13, 2026
…w#122641)

* fix(ui): preserve archive state across stale refreshes

* fix(ui): retain archive state across navigation

* fix(ui): ignore stale archive events

* fix(ui): scope archive state to session identity

* fix(ui): require session identity for presentation metadata

* fix(ui): require exact archive identity
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 maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M 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