Repository navigation
refactor(gateway): generalize bulk session patches - #120629
Conversation
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 8, 2026, 5:47 PM ET / 21:47 UTC. ClawSweeper reviewWhat this changesThe branch replaces the unshipped archive-only bulk session RPC with a bounded shared bulk patch RPC used by Control UI archive, read-state, and category actions. Merge readinessNo actionable patch defect was found. This protected maintainer PR keeps session mutation policy in the Gateway’s canonical singular patch path; it needs exact-current-main integration review before merge. Priority: P1 Review scores
Verification
How this fits togetherControl UI and native clients send session organization requests to the Gateway, which validates scope and authorization before applying canonical per-session patches. Batch outcomes then drive a single sidebar refresh while older Gateways retain serial patch behavior. flowchart LR
UI[Control UI multi-select] --> RPC[Bulk session patch request]
Native[Native clients] --> RPC
RPC --> Validate[Schema and scope validation]
Validate --> Authorize[Authorize each target]
Authorize --> Patch[Canonical session patch]
Patch --> Outcomes[Ordered batch outcomes]
Outcomes --> Refresh[Sidebar refresh]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +179, Tests +411, Docs +1, Other +152. Total +743 across 35 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared bulk patch contract that delegates to canonical singular patches, with no alias for the unshipped archive-only RPC, after current-main integration confirms native/client fallback behavior. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor PR, not a report of a failing user path; its Gateway and UI behavior is covered by focused source and test inspection. Is this the best way to solve the issue? Yes. A single bounded bulk envelope reusing canonical singular session patches avoids retaining two mutation-policy owners; an archive-only alias would preserve duplicate behavior without a shipped compatibility need. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 909509a5db8d. LabelsLabel 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 (4 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5c16ba2 to
bcfb4f1
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Land-ready proof for exact head
ClawSweeper rank-up moves are satisfied by the current-main rebase, protocol/client build, exact-head CI, and this exact-head review. Main advanced again after the frozen rebase; repository landing policy treats behind-main drift as advisory when live mergeability remains true, while the native prepare/merge guard validates the actual merge result. No additional drift-only rebase is being introduced. |
|
Merged via squash.
|
* refactor(gateway): generalize bulk session patches * fix(gateway): normalize bulk session fences * refactor(gateway): simplify normalized target fence * test(ui): align disconnected session wording
What Problem This Solves
The first fast multi-session archive path introduced an archive-specific
sessions.archiveManyRPC while other sidebar batch mutations still serializedsessions.patchcalls. That left two mutation shapes for the same policy owner and did not improve bulk read/unread or category changes.Why This Change Was Made
This replaces the unshipped archive-specific contract outright with bounded
sessions.patchMany({ targets, patch }). The shared patch supports the existing singular mutation surface, derives write/admin scope from the patch fields, authorizes every target before dispatch, and delegates each target to canonicalsessions.patchwith target-local commit-time authorization fencing.The Control UI now uses the same batch path for archive/restore, read/unread, and category assignment. Older Gateways fall directly back to serial
sessions.patch; nosessions.archiveManyalias or compatibility layer remains.User Impact
Multi-select session organization keeps the fast archive behavior and now applies it consistently to read/unread and category changes. Ordered partial failures, stale-scope protection, one authoritative refresh, archive undo, and older-Gateway behavior are preserved. An all-archived selection also now displays the correct
Restore {count}action label.Evidence
pnpm build: passed.sourcekitdInProc.framework; exact-head hosted CI is required to prove that lane.