Repository navigation
feat(sessions): snooze sessions from the sidebar menu - #161960
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 30, 2026, 4:59 PM ET / 20:59 UTC (Revision 13). ClawSweeper reviewWhat this changesThe branch adds Gateway-stored session wake times, Control UI snooze and wake controls, sidebar filtering, protocol models, tests, and documentation. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain Keep open. Current main does not offer session snooze, so this PR remains useful. The prior P1 finding persists on the pinned head: a previously valid numeric plugin mirror can be interpreted as a snooze after upgrade and hide an ordinary session. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway stores session entries and publishes session rows to clients. The Control UI uses those rows to decide which sessions appear in the sidebar and when a snoozed session should reappear. flowchart LR
A[Sidebar menu] --> B[Session patch request]
B --> C[Gateway validation]
C --> D[Stored session entry]
E[Messages and completed runs] --> D
D --> F[Published session row]
F --> G[Sidebar filter and wake timer]
Decision needed
Why: The PR body accepts an experimental plugin registration collision, but it does not explicitly accept the separate silent sidebar reclassification of already stored sessions. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +534, Tests +1066, Docs +18, Other +16. Total +1634 across 76 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Give core snooze state an unambiguous owner or migrate recorded legacy slot ownership before row projection, then verify a copied released store reopens with the session visible and plugin state intact. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence upgrade path: persist a future numeric promoted slot in a released store, then reopen it with this head. This read-only review did not execute that path. Is this the best way to solve the issue? No, the Gateway and sidebar ownership is appropriate, but reusing a formerly available durable plugin-slot name without migration is not yet upgrade-safe. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 33513de8d98a. LabelsLabel changes: No label 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 (12 earlier review cycles; latest 8 shown)
|
85c2e22 to
ec3be15
Compare
|
04e469b to
ef6163a
Compare
Active session lists need a way to defer a conversation without archiving it or interrupting its work. Store and protocol retain optional wake and set timestamps in entry JSON and row snapshots, reserving the core names against plugin slot collisions. Scoped patches validate durable identity, future wake times, and eligible roots. Pin and archive clear snooze; snooze keeps pin. Gateway user interactions and completed activity clear snooze against the current entry, including snoozes set during a run. System events and preserved-state runs keep it. Existing row publications carry the change. The Control UI sidebar adds calendar-aware presets, Snoozed filtering, Wake and Undo actions, localized wake labels, and deadline invalidation through the existing attention controller. Root rows reuse the existing trail, and adopted catalog rows share the visibility projection. Docs explain the active-session overlay and patch contract. Coherent sibling modules and shared test fixtures keep the original owners within their line budgets without removing coverage. Release-note context: snooze a sidebar session until a preset time, send it a message, or let its run finish to bring it back. Snoozing never stops or blocks the session, and its Gateway-owned state follows every client.
…snooze
The Snooze submenu labels already name the day ("Tomorrow"), so the time
column now shows only the clock time except for "Next week", which keeps
its weekday. The shared Control UI session fixture now applies snoozedUntil
patches with the same rules as the Gateway (null wakes, archive and pin
clear, a new wake time restamps), so the mocked dev server and e2e harness
hide and restore snoozed rows like a real Gateway.
Automatic archival (active-session cap, age retention, stale dashboards) writes archive facts without the sessions.patch path, so a snoozed session kept its wake time through the archive and a later restore left it hidden from the Active list. The canonical entry shape now removes snoozedUntil and snoozedAt from any archived entry, which covers every persisted write, every read projection, and the existing-entry projection the restore patch uses.
ecfe31b to
c3a4b1f
Compare
|
CI attribution for run 36770343804 on head c3a4b1f (117 success, 2 failure, 28 cancelled by fail-fast):
Both failed jobs were rerun once on the same head. Earlier heads also inherited a main-side red ( |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* feat(sessions): snooze sessions from the sidebar menu
Active session lists need a way to defer a conversation without archiving
it or interrupting its work.
Store and protocol retain optional wake and set timestamps in entry JSON
and row snapshots, reserving the core names against plugin slot collisions.
Scoped patches validate durable identity, future wake
times, and eligible roots. Pin and archive clear snooze; snooze keeps pin.
Gateway user interactions and completed activity clear snooze against the
current entry, including snoozes set during a run. System events and
preserved-state runs keep it. Existing row publications carry the change.
The Control UI sidebar adds calendar-aware presets, Snoozed filtering,
Wake and Undo actions, localized wake labels, and deadline invalidation
through the existing attention controller. Root rows reuse the existing
trail, and adopted catalog rows share the visibility projection.
Docs explain the active-session overlay and patch contract. Coherent
sibling modules and shared test fixtures keep the original owners within
their line budgets without removing coverage.
Release-note context: snooze a sidebar session until a preset time, send
it a message, or let its run finish to bring it back. Snoozing never stops
or blocks the session, and its Gateway-owned state follows every client.
* chore(sessions): restore the plugin-seam note on lifecycle timestamps
* fix(ui): keep snooze preset times compact and teach the mock fixture snooze
The Snooze submenu labels already name the day ("Tomorrow"), so the time
column now shows only the clock time except for "Next week", which keeps
its weekday. The shared Control UI session fixture now applies snoozedUntil
patches with the same rules as the Gateway (null wakes, archive and pin
clear, a new wake time restamps), so the mocked dev server and e2e harness
hide and restore snoozed rows like a real Gateway.
* fix(sessions): drop snooze metadata when an entry is archived
Automatic archival (active-session cap, age retention, stale dashboards)
writes archive facts without the sessions.patch path, so a snoozed session
kept its wake time through the archive and a later restore left it hidden
from the Active list. The canonical entry shape now removes snoozedUntil
and snoozedAt from any archived entry, which covers every persisted write,
every read projection, and the existing-entry projection the restore patch
uses.
* chore(protocol): regenerate Swift models for session snooze fields
* test(gateway): keep the snooze session-utils test in inventory order
* test(ui): walk the Snoozed status option in the sidebar filter keyboard test
* test(ui): expect Snoozed after one arrow from Active in the owner filter e2e
What Problem This Solves
The sidebar has archive and pin, but no way to park a session until later without archiving it (which blocks work) or losing it in the list.
User Impact
Users can snooze a sidebar session from its context menu until a preset time. Sending it a message or letting its run finish wakes it early; a Snoozed filter lists parked sessions with a Wake action. Snooze never gates work, drains, Cron, or worktrees.
Native macOS/iOS clients ignore the new optional fields; native client parity is a follow-up. No database column or migration is added.
Why This Change Was Made
The Gateway owns a snooze overlay on the active lifecycle, with
snoozedUntilandsnoozedAtstored only inside the session entry JSON and projected raw into session rows.sessions.patchacceptssnoozedUntil: integer | nullwithexpectedSessionId, rejecting archived, child, and protected sessions and past times. Archive and pin clear a snooze; snoozing keeps a pin. Timer wakes are derived client-side without a server event. The Gateway clears snooze on a real inbound interaction and on a completed user-facing run, including a snooze set while that run was in flight.The Control UI adds a Snooze submenu with In 1 hour, In 3 hours, This evening (18:00), Tomorrow (09:00), and Next week (Monday 09:00) presets; a Wake session item carrying the wake time; an Undo toast; a Snoozed status filter; and a wake-time trail in Snoozed/All views. One deadline timer lives in the existing attention controller. The shared Control UI mock fixture follows the same snooze rules so the mocked dev server and e2e harness reflect the feature.
The line-cap ratchet required coherent, behavior-identical sibling extractions:
sessions-patch-lifecycle-flags.ts,session-menu-snooze.ts,app-sidebar-session-snooze-visibility.ts,session-entry-lifecycle-carry.ts, and*.snooze.test.ts.Documentation is updated in
docs/web/control-ui/sessions-and-sidebar.md,docs/web/control-ui/feature-reference.md,docs/gateway/protocol/rpc-session-control.md, anddocs/reference/session-management-compaction/schema.md.Follow-ups: native client parity. Automatic pagination backfill was reviewed and intentionally not added; the existing bounded-read and manual continuation behavior remains.
Evidence
Isolated Codex autoreview on the full branch is scoped-clean through P2 (P0–P2). An earlier
node scripts/check-changed.mjsrun passed; current rebase validation is recorded below. The initial 683 targeted tests passed, followed by 99 post-extraction tests and the 16-test visibility/catalog fixture selection. These completed proofs are reused for publication.Measured command wall seconds with
--maxWorkers=1are below. UI runs used the unit project andTZ=America/Los_Angeles. Initial measurements precede the sibling extractions; the post-extraction column records the affected reruns. Database-backed command wall time includes worker preparation, imports, and transforms. The three new sibling test bodies took approximately 0.994 s, 3.556 s, and 0.150 s respectively. CI timing is pending attachment to this head.packages/gateway-protocol/src/schema/sessions-patch.test.tspackages/gateway-protocol/src/index.test.tssrc/config/sessions/sessions.test.tssrc/gateway/sessions-patch.test.tssrc/gateway/session-utils.test.tssrc/gateway/session-event-payload.test.tssrc/shared/session-method-scopes.test.tssrc/agents/command/session-store.test.tssrc/auto-reply/reply/session.heartbeat-no-reset.test.tsui/src/lib/sessions/session-snooze.test.tsui/src/components/session-menu.test.tsui/src/components/app-sidebar-session-archive-visibility.test.tsui/src/components/session-attention-controller.test.tsui/src/components/app-sidebar-session-types.test.tsui/src/components/session-organizer-batch-mutations.test.tsui/src/components/app-sidebar-session-catalogs.test.tssrc/agents/command/session-store.snooze.test.tssrc/gateway/session-utils.snooze.test.tssrc/gateway/sessions-patch.snooze.test.ts*The visibility and catalog files ran together in one 7.954-second command. Large original test files were not rerun wholesale after extraction; affected siblings and owner tests were rerun, and all 27 selected test-type graphs passed. Full repository and live channel/Gateway suites were not rerun for publication.
Rebased onto main and fixed archived-entry snooze retention in
ec3be151bb7a; the regression insrc/config/sessions/sessions.test.tspasses with all 38 tests in that file.The eight-commit branch was rebased onto
f02c8eba42a2after main introduced a documentation conflict. The resolution preserves main's archive creator/admin authorization text and all snooze text. All eight commit messages are unchanged; the range-diff changes only that documentation context. Current published head:c3a4b1f43c84.Current integration proof:
pnpm protocol:check:swiftpassed (2.699 s);pnpm test test/vitest-cli-ownership.test.ts --maxWorkers=1passed all 387 tests (78.761 s); the completenode scripts/check-changed.mjspassed (1,972.001 s), including native Swift lint and app contract tests. The earlier local SwiftLint exception did not recur. The coordinator also ran the owner-filter keyboard E2E file after its expectation correction (4 passed).Prior-head CI run 36765307756 completed with 143 successful, 4 failed, 0 cancelled, and 14 skipped jobs. The corrected UI E2E lane passed.
checks-node-changed-compact-small-5failed because main removedsrc/plugins/hooks.security.test.tswhilesrc/plugins/compat/registry-records.tsstill references it; the failing test and registry inputs are unchanged by this PR and byte-identical on the tested main parent and the observed current main.pr-fail-fastreceived HTTP 409, and the aggregate gate failed.The other failing job,
checks-node-changed-extensions-bundle-8, had fourmanager-publication-settlement.test.tscases miss a five-second native-startup marker. The exercised worker-domain path does not invoke snooze behavior. A bounded baseline on main662b77618800through Blacksmith Testbox run 36769441510, constrained to two CPUs/8 GiB, Node 24.19.0, and two workers, passed all 9 files / 173 tests in 115.85 s wall. This larger-host constrained reproduction is inconclusive; it does not establish a timeout fix or prove the historical CI failure's cause. The lease and temporary baseline worktree were cleaned up.Current-head CI run 36770343804, attempt 1, finished with 117 successful, 2 failed, 28 cancelled, and 14 skipped jobs. The coordinator attributed both root failures to hosted flakes: the npm-pack lifecycle file passed locally on this exact tree (23/23), and the sign-in file passed locally (1/1); its
note/confirmmismatch is also a known hosted intermittent seen on unrelated PRs. Neither test file is touched by this PR. The earlier main-side registry red was fixed on main in09e77e135f09.Attempt 2 completed with 128 successful, 2 failed, 17 cancelled, and 14 skipped jobs. The npm-pack job passed; only the same known sign-in assertion repeated, plus the aggregate gate. All 17 cancellations are attributed to that Node matrix failure, with no other failed step or test diagnostic in their annotations. The maintainer explicitly authorized the native pre-existing-CI exception for this exact head when only the attributed flakes recur. The native pre-existing-CI admin-evidence route merged this exact head as
d63df96b48a69de1e191ed8524920693f7a9014f; GitHub reports MERGED and the commit was verified onorigin/main. Failed and cancelled coverage remains recorded. No new push, rebase, or test/CI rerun was performed by the lander.Review adjudication:
pluginExtensions[pluginId][namespace]state remains stored. An external plugin using either exact name can encounter a mirror/registration collision after an unsupported-version upgrade, and a legacy future numeric mirror namedsnoozedUntilcould be classified as snoozed after that upgrade. Namespaced plugin state remains stored. This conditional visibility risk is retained under the frozen field design and released experimental API policy; no supported affected consumer or protected slot-specific compatibility window was identified. Copied-store visibility was not tested, and no such proof is claimed.snoozedUntil: nullwake, following existing archive Undo semantics, with connection and durable-session identity fences. A newer local toast normally replaces the older one. Cross-client/in-flight writes remain last-write-wins, so an older visible Undo can clear a newer snooze; conditional rollback would be a separate Gateway concurrency contract, not the frozen behavior requested here.Screenshots
All six captures were inspected and contain only synthetic fixtures from the mocked Control UI.
Before / after context menu:
Before / after status filter: