Skip to content

fix: keep restored sessions unpinned unless archive is undone - #181721

Merged
vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/archive-unpin
Oct 23, 2026
Merged

vyctorbrzezowski merged 3 commits into
mainfrom
brzezowski/archive-unpin

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Closes #181719

What Problem This Solves

Fixes personal session pins reappearing when a user restores an archived session later.

User Impact

Archiving takes effect immediately and removes the current profile's personal pin. The toast's explicit Undo restores both the session and its previous personal pin. Once the toast is gone, Restore session on the Archived page restores the session unpinned, using the existing selected sort.

Why This Change Was Made

Personal navigation references are independent of shared session pin metadata. Confirmed archive actions remove the reference; only the Undo callback retains the previous personal pin. Its restore operation adds pins only for successful, current-profile restorations and preserves newer manual pin changes.

Other profiles, rail shortcuts, shared-pin behavior, and sorting remain unchanged. No archive delay, new persistent state, or retrospective preference rewrite is introduced.

Evidence

  • Real Control UI with the repository's mocked Gateway: header and Sessions-page Undo restore the personal pin; after the toast expires, Restore from the Archived page leaves it unpinned.
  • Both Undo browser cases failed on the preceding implementation and passed with the correction. The original main reproduction of ordinary restoration re-pinning the session remains documented below.
  • Owner suites: 68 passed (5.75s combined wall). The final archive-owner file passed 14 tests in 5.42s wall; it covers rejected restore, profile retirement, newer manual pin/unpin, preserved rail references, and partial batch Undo.
  • Browser suite: all ten cases passed across full and focused runs. The final Archived-page case took 2.201s test time and 35.47s wall including the shared production build.
  • UI and affected test typechecks, targeted lint and formatting passed. Independent review found no additional P0–P2 defects in the working-tree correction.
  • Broad CI is bound to the pushed head. The earlier full local changed-check was not green because of unused exports in unchanged scripts; no baselines were changed.

Main before the fix: ordinary restoration brings the session back under Pinned.

Main before: ordinary restore re-pins

After: restoration from Archived after the toast expires leaves the session unpinned.

After: later Restore stays unpinned

Explicit Undo before this correction (original PR head d3b7850c58f3): the personal pin was lost.

Before: Undo lost the personal pin

Explicit Undo after this correction restores the personal pin.

After: Undo restores the pin

@clawsweeper

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

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review October 23, 2026 15:25
@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. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Remove the current profile’s personal session pin after a confirmed archive so Unarchive and Undo restore an unpinned conversation.

Example: Personally pin “Release checklist” with shared pinned=false, archive it, then select Unarchive.

  • Before: The conversation returns under Pinned.
  • After: The conversation returns to the ordinary list using the selected sort.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with inspected visual proof and green exact-head CI; browser evidence uses the deterministic Gateway fixture.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show the changed sidebar placement in the built Control UI with a mocked Gateway; supplied red/green browser results cover header Unarchive, header Undo, and Sessions-page Undo. The existing profile-scoped preference writer and serialized format remain unchanged, with cleanup limited to newly confirmed archive actions.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A personally pinned conversation unexpectedly returns under Pinned after Archive followed by Unarchive or Undo.
Reason: The maintainer-authored report and PR explicitly choose this behavior, and the narrow repair covers the affected archive surfaces while preserving independent navigation choices.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a source-confirmed current-main defect, has approved maintainer direction, and has no actionable correctness or security findings.

Priority: P2
Reviewed head: d3b7850c58f31061e105870260598f72a9cfee83

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI archive actions send mutations through the session capability, then update personal navigation preferences after successful confirmation; sidebar rendering consumes those preferences independently of shared session pin metadata.

flowchart TD
  A[Header sidebar or Sessions page] --> B[Existing archive action owners]
  B --> C[Session capability]
  C --> D[Gateway archive confirmation]
  D --> E[Current profile navigation preferences]
  E --> F[Sidebar placement]
  D --> G[Unarchive or Undo]
  G --> C
Loading

Technical review

Best possible solution:

Retire only the acting profile’s personal session reference after successful archive confirmation, preserving shared-pin Undo, rail shortcuts, other profiles, and sorting.

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

Current-main source establishes that a personal reference survives archive when shared pinned=false and becomes visible again on restore; the supplied browser captures corroborate the symptom, but this read-only review ran no target code.

Is this the best way to solve the issue?

The patch is the smallest complete repair at the existing single, batch, and Sessions-page confirmation owners, without introducing another state store or changing shared archive semantics.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Personal pin retention across archive restoration changes intended behavior with a stated reason (054ac7a: fix: keep pinned sessions in the sidebar by default #178066 separated sidebar pins from rail shortcuts and explicitly retained saved references while hiding archived pins; this PR explains why newly confirmed archives should instead retire the acting profile’s reference.)
  • Single-session archive cleanup keeps the original intent (33f4714: fix(ui): keep duplicate session rename errors in the modal #168034 extracted the existing patch path while localizing rename errors; its carried archive cleanup linked personal reference removal to shared pin metadata, rather than establishing that linkage as a product requirement.)
  • Batch outcomes and Sessions-page confirmation lifetime keeps the original intent (refactor(gateway): generalize bulk session patches #120629: Bulk patches preserve ordered per-target outcomes and canonical mutation ownership; later archive owner refactors preserve confirmation and Undo across page navigation with connection and incarnation checks, all retained by this patch.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +3, Tests +84. Total +87 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 10 7 +3
Tests 2 89 5 +84
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 99 12 +87

Root-cause cluster

Relationship: same_root_cause
Canonical: #181719
Summary: This PR repairs the canonical personal-pin restoration report; automatic retention protection is adjacent work with a different trigger and owner.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: Unexpected pin restoration disrupts session organization, but conversations remain accessible and users can unpin them.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Unexpected pin restoration disrupts session organization, but conversations remain accessible and users can unpin them.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • 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.

Reviewed October 23, 2026, 11:43 AM ET / 15:43 UTC.

@vyctorbrzezowski vyctorbrzezowski changed the title fix: keep restored sessions personally unpinned after archiving fix: keep restored sessions unpinned unless archive is undone Oct 23, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 5e2f560 into main Oct 23, 2026
86 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/archive-unpin branch October 23, 2026 23:52
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
…aw#181721)

* fix: keep restored sessions personally unpinned after archiving

* fix: restore personal session pins when undoing archive

* test: reject archive Undo pins from a retired profile
@vyctorbrzezowski vyctorbrzezowski self-assigned this Oct 25, 2026
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI: unarchiving restores the previous personal session pin

1 participant