Repository navigation
fix: session groups leak across agents - #142863
vyctorbrzezowski wants to merge 9 commits into
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. |
c4dc4f7 to
a2e1158
Compare
|
Codex review: needs real behavior proof before merge. Reviewed September 23, 2026, 2:52 AM ET / 06:52 UTC (Revision 23). ClawSweeper reviewWhat this changesThe branch gives each agent an independent session-group catalog, migrates existing groups, and updates Gateway, web, and native clients to use agent-scoped operations. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 10 items remain Keep this maintainer-owned draft open under the recorded migration deferral. Current main and the latest release still use a global catalog; the retained cleanup PRs do not replace the ownership fix. Both previous native findings remain unresolved. Priority: P2 Review scores
Verification
How this fits togetherSession groups organize conversations and supply defaults for new sessions. The Gateway stores their catalogs, while web and native clients display them and submit group mutations. flowchart TD
A[Web and native clients] --> B[Agent-scoped group requests]
B --> C[Current authority checks]
C --> D[Gateway group catalog]
E[Legacy groups and preferences] --> F[Doctor and client imports]
F --> D
D --> G[Scoped catalogs and change events]
G --> A
Before merge
Findings
Agent review detailsSecurityNeeds attention: The iOS dialog retains intent across connection replacement without retaining its original authority; no additional supply-chain concern was identified in the inspected changes. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: A future focused cutover should give the existing catalog owner agent-qualified identity, preserve installed state through verified upgrades, and bind every client mutation to its originating live connection. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main lists one global catalog, and the linked report supplies a two-agent, same-name reproduction. The remaining PR defects have explicit delayed-dialog and pending-import triggers; no runtime tests were executed in this read-only review. Is this the best way to solve the issue? The Gateway-owned agent-qualified catalog is the appropriate repair boundary, but this combined branch is not ready: the native lifecycle defects remain and migration compatibility is unqualified. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2e9a2eceb11b. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What 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 (22 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review At Addressing the five pre-merge items in the previous review:
The updated Deslop section records the cuts, split candidates and dependencies, and exact validation boundaries: 126 → 104 files, +5,465/-1,778 → +4,504/-1,281 (20.1% fewer changed lines), 328 focused tests plus 15 browser E2E cases passed, and a fresh cleanup-delta autoreview found no actionable P0–P2 findings. No server/web behavior assertions or scenarios were removed. Full check results and remaining proof limits are in the PR body. This remains a draft. Native/client compatibility readiness requires maintainer judgment before any eventual merge; no merge is requested. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Reuse the personal visibility policy without changing SQLite or shared group ownership. Keep explicit visibility choices and team views unchanged. Co-authored-by: vyctorbrzezowski <[email protected]>
Preserve the original PR commits as history while retaining the reviewed main-based visibility fix. The resulting tree is unchanged from f7234c0; no schema, RPC, or native changes remain in the PR diff. Co-authored-by: vyctorbrzezowski <[email protected]>
Related: #142863 Reworked directly on main, replacing the retained foundation from #153828. This no longer depends on the defaults PR or the held migration drafts. ## What Problem This Solves Fixes deleted groups reappearing when deletion overtakes session creation or category assignment before catalog registration settles. ## User Impact Group deletion waits for earlier committed session writes and their registration. Bookkeeping failures warn and reload the catalog instead of falsely reporting that an already-saved session write failed. Reassigning the same category can repair missing bookkeeping. Session updates retain their place in the writer queue, and closing a session database no longer hangs behind revoked cleanup waiting for that same writer. Already-admitted writes still settle before close. The catalog remains global. No agent-owned-group activation, schema change, new configuration, public RPC change, or Gateway deployment is included. Fresh creation remains isolated from unrelated archive-export failures; existing-session and alias adoption retain their historical retry and visible failure behavior. Canonical bytes, retention protection and explicit recovery are preserved. ## Why This Change Was Made Keep the original physical writer through commit settlement, existing publication and registration, with live authority checked before committing and installing results. Remove late duplicate registration and the redundant replacement wrapper. Touched durable access now uses the existing history reader, agent executor and shared-state reader. Supported aliases retain canonical replacement and native deletion custody. CI-exposed custom-store and first-creation identity defects are repaired at those existing owners; no parallel registry, writer or archive-retry manager is introduced. ## Evidence - Actual registered create/patch versus group-delete races demonstrate the original defect and its repair. Proof includes close joining, physical-path/environment changes, transaction/commit revocation, uncertain publication, native rollback and rejected/no-write suppression. - Unchanged guarded SDK suite: **24/24**. Creation/replacement/archive owners: **36/36**. Registered Gateway race/siblings: **14/14**. Reclamation repair: **73/73**, including the original board and Zalouser failures. These selections overlap earlier proof and are not combined into a larger total. - Historical adoption-triggered archive retry is restored. Real collision/recovery fixtures verify exact bytes/hash, attempts, retained transcript/metadata, publication ordering and zero host data SQL. Fresh creation and generic recovery controls remain intact. - Static dependency-cycle and test-inventory defects found by hosted CI are corrected. Architecture checks pass; both original routing suites pass **501/501**. - Fresh independent review (R3) of the complete revised candidate is **scoped-clean through P2**, with no actionable findings. It reviewed source/evidence, not an independent execution of the tests. The subsequent mechanical removal of an unreachable snapshot wrapper migrated its three test callers to the existing connection-bound kernel; final snapshot/type/lint/export/build checks cover that cutover. - A subsequent hosted-CI teardown race is repaired: read-admission retirement no longer loses an already-acquired exact lease receipt needed after native exit. A real-worker regression fails on the published predecessor and passes with the base owner and repair; this substitutes one owner, not a full baseline. **109 focused tests pass**, including original failing consumers, with core/test types and typed lint clean. Fresh independent R4 review of this two-file correction is **scoped-clean through P2**; it did not rerun tests. - The next hosted run exposed replacement callbacks losing their FIFO turn and a planning-close deadlock. Exact database locators now reserve the existing queue before worker-owned schema discovery; revocation removes only pending maintenance admissions. Unchanged original cases reproduce RED and pass after repair. Final-source ownership proof is **93/93**, with production/test types, typed lint, formatting and delta ratchets clean. Independent R5 review of the 11-file correction is **scoped-clean through P2**; tests were not independently rerun by the reviewer. A separate final integration applied the frozen repair to the actual failing CI merge `27bf437c`, including its main-side worker-runtime changes: the original config lane passed **90 files / 1,654 tests in 189.63s**, on Node 24.19.0 with two workers and retries disabled. This is local exact-merge integration, not a substitute for current-head hosted CI. **Current-head Claw review (c3860f0, September 23 at 16:52 UTC):** no actionable introduced or security defect was found. Its explicit source assessment withdraws the prior generic migration-proof request and confirms no schema, serialized representation, retention-policy or public-RPC change. The generated checklist still repeats that withdrawn request; it is not an unresolved source finding. Existing-state alias, archive-recovery, authority and lease-cleanup evidence above remains applicable. Current-head hosted CI and native merge gates remain required. **Qualified integration baseline (11cc34f):** production and all source core-test type graphs, revised-candidate typed lint, all three canonical unused-export scans, and canonical build passed. After the final mechanical cutover, creation snapshots passed **13/13**, production/session-test types and two-path typed lint passed, all three unused-export scans reported zero entries, and the final build passed in **225s**. All 48 source hashes stayed unchanged through that baseline qualification and publication. The subsequent seven-line production receipt-lifetime correction and its regression have separate focused qualification above; at that stage the other 46 paths were unchanged. The later FIFO/cancellation correction has separate proof above; no fresh full local build is claimed for it. Current-head hosted CI remains required. **Retained limitation:** the earlier full-tree core lint scan failed on unchanged `src/cron/service/timer.test.ts` (1,022 counted lines versus its 1,000-line allowance). Its Git blob is identical to the selected main base. No allowance was raised; the full changed-check wrapper is not claimed green. Earlier local proof used Node 26 versus hosted Node 24.19. New FIFO/cancellation reproduction and qualification use verified Node 24.19.0. No live-Gateway, native-platform or published-driver upgrade proof is claimed. **Unresolved timing evidence:** hosted predecessor CI observed dirty session describe at 124.39ms against its unchanged 100ms assertion (zero transcript reads; 1,995 rows still pending). One original-order attempt stopped earlier in the separate cron process on six real-HTTP delivery cases, including a 120s timeout (1,567 passed); those failures remain unexplained and were not retried. The still-unexercised 89-selector Gateway plan was then run once, with unchanged assertions: describe 32.62ms, dirty describe 15.25ms, zero transcript reads and 1,983 rows pending. The Gateway shard itself was not green: 29 failed, 974 passed, one skipped and two unhandled errors; HTTP cases observed the host secret-egress proxy refusal/502 response rather than their expected local endpoint payload. That transport boundary was not bypassed. The latency case is a non-reproduction, not a timing fix or CI waiver. Local Node 26 differs from hosted Node 24.19; no timing limit was changed. <details> <summary>Regression attribution, review dispositions and measured costs</summary> The custom-store transcript failure came from reinterpreting a prepared physical database as a logical store. Reading its already-resolved owner fixes the producer; transcript guards are unchanged. The original board deletion failure directly showed an unresolved host shared-state identity versus the worker's first-created physical identity. Restoring only the baseline deletion lookup made the unchanged test pass. The repair publishes first creation through the canonical admission owner before unchanged receipt checks, and settles errors through existing failure/termination handling. This was a narrow counterfactual, not a whole-baseline run. Board 22/22, Zalouser 5/5, reclamation custody 33/33, shared-state lifecycle 11/11 and the extended owner file 2/2 pass. The earlier Signal-alias P2 was reproduced at the actual admitted entry point and repaired. R2 alleged a newly missing original-snapshot CAS across an asynchronous creation callback. A deterministic comparison with the old entry/projection owners showed the same low-level lost-update behavior in both; newer persisted ownership survived. Normal Gateway create/patch retain the lifecycle fence and caller/session checks. That finding remains disposed as inherited, not claimed fixed; the comparison substituted two owners, not the entire baseline. The earlier archive comparison restored 22 production paths, likewise not a full-baseline run. Revised archive tests fail on the pre-repair candidate and pass after restoring the historical retry. Measured standalone test commands use the canonical repository runner with `--maxWorkers=1` (direct wrapper when avoiding dependency reconciliation): - Revised archive file: 8/8, **19.24s wall**, including 2.505s warm worker preparation; canonical/alias adoption 2.368s/2.422s; max RSS 866,692 KiB. - Earlier reclamation file: 2/2, **38.70s wall**, including 29.43s cold compilation; test bodies total 1.507s. No new test case or worker boot. The 71-case boundary batch took 96.02s. - Latest reclamation file: 3/3, **33.60s wall**, including 26.148s cold compilation; new real-worker late-receipt regression 966ms. The 106-case sibling/consumer batch took 102.29s. Neither passing uncontrolled replay proves the CI interleaving was fixed; the deterministic RED/base-owner/GREEN regression establishes the repair. - New queue-cancellation case: changed file **12/12, 31.70s wall**, cold compiler dominated; new case **1ms**. Revised replacement-worker file: **7/7, 22.74s wall**; new unkeyed shared-owner/zero-host-SQL case **1,656ms**. Final 93-case owner batch took **51.99s**. The real worker case proves schema discovery and the no-host-SQL boundary that a mocked publisher cannot. Hosted cost for these new cases is not yet available. - Creation-worker: 34.01s cold wall, including 18.074s preparation; its three alias cases total 4.011s. Prior unchanged-owner measurements: replacement-worker 14.64s, creation-snapshot 19.97s, create/category 23.58s, patch effects 2.69s, registration 24.10s, catalog 48.41s, create preparation 18.36s, atomic initialization 13.82s. One counterfactual compiler subprocess exited 139 before tests. One prerequisite retry with supported bounded compiler concurrency completed. That tooling crash remains unexplained, not relabeled as a product failure or claimed fixed. No manual CI reruns, weaker assertions, relaxed limits or modified baselines were used. The isolated exact-merge proof initially lacked workspace-local `quickjs-wasi`/Markdown dependency links; its own frozen install repaired that setup, and the single prerequisite retry passed. Shared candidate dependencies and source were not changed. 55 files, +2,477/−460: production 42 files, +1,151/−331; tests/support 12 files, +1,315/−125; owning documentation 1 file, +11/−4. Growth comes from required worker adaptation, pending-admission cancellation at the existing queue owner, and lifecycle/data-preservation proof—not another queue or presentation-module extraction. The [failed predecessor run](https://github.com/openclaw/openclaw/actions/runs/35878886549) tested merge 27bf437c (2ab085b plus main 60d25b9). Its sole failed test job first showed three replacement FIFO failures, then a planning-close wait cycle and teardown cascades; this is not attributed to infrastructure or waived. The accepted auto-merge request was explicitly canceled through native recovery before repair. Current-head hosted CI and native replacement recovery remain required. Historical [CI run 35670778480](https://github.com/openclaw/openclaw/actions/runs/35670778480) qualified the retired stacked head `57fecf53`, not this rewrite. The first rewritten head `92fa7c88` passed its focused local selection/build, then hosted CI exposed the defects repaired here. Neither old head's checks qualify this revision. </details> Derived from the work requested by @vyctorbrzezowski; contributor credit is retained. ## Work sessions - [Original discussion](https://team.openclaw.ai/chat/roboclaw/dashboard/28feaf46-a23c-468e-bfad-ab44a1d5ac7b) - [Implementation and verification](https://team.openclaw.ai/chat/roboclaw/dashboard/77bcdbfb-d371-44a4-b5fb-71982a391c73) - [Earlier registration implementation](https://team.openclaw.ai/chat/roboclaw/070c58af) - [Transcript and archive compatibility repair](https://team.openclaw.ai/chat/roboclaw/~key/subagent/efba26c0-af82-4536-9304-fc99efa8f5d1) - [Reclamation diagnosis and repair](https://team.openclaw.ai/chat/roboclaw/~key/subagent/b6e66b22-c1f6-4497-9a12-8a90796014e3) - [Late-lease cleanup repair](https://team.openclaw.ai/chat/roboclaw/~key/subagent/04bbd182-7274-4ed0-b7ac-63095b94a425) - [FIFO and handle-lifecycle repair and verification](https://team.openclaw.ai/chat/roboclaw/~key/subagent/95ed6726-6bcd-4cf0-88d9-608a6cd292d1) Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: shakkernerd <[email protected]>
Related: #142863 Replaces #153883; the original stays open until this fix lands. ## What Problem This Solves Selecting an existing session group named `__new-group__` opens New Group instead of assigning the session to that group. ## User Impact All group names behave as data. New Group, ordinary assignment, drag-and-drop and denied-write behavior stay intact. No appearance, permission, schema or RPC changes. ## Why This Change Was Made Mark the create option explicitly and inspect the selected option rather than reserving a group-name string. Keep the current `category-cell.ts` owner and its existing DOM guard; do not restore the earlier extraction. The two category tests move out of the oversized view test file without losing assertions, adding a colliding-name case and a positive create-action control. Production shrinks by two lines; three files total, +120/−104. ## Evidence - On main `764c9331a31`, the real Sessions renderer regression failed for `__new-group__` while two controls passed. With the fix, all three category cases and all 51 remaining view cases pass. - Per-file `pnpm test <file> --maxWorkers=1`: category suite 2.25s wall (collision 17ms); remaining view suite 2.64s wall. [Hosted CI](https://github.com/openclaw/openclaw/actions/runs/35928486234): category test execution 0.128s (collision 48ms); remaining view tests 1.087s. - Fresh canonical changed checks passed (format, lint, typegraphs, line/assertion guards and dead exports). Independent P0–P2 review: scoped-clean, no findings. Current-head ClawSweeper review completed with no findings. Exact-head hosted CI remains enforced for landing. - Behavior-only DOM boundary proof; no live Gateway or screenshot evidence is claimed. <details> <summary>Replacement provenance and earlier CI limitation</summary> The original PR could not be safely rebased through the native ancestry-preserving publisher. Its accepted auto-merge was cancelled through native retained-outcome recovery before this authorized replacement was started from current main. No old receipt or guard was removed. The old head’s [Node small-18 failure](https://github.com/openclaw/openclaw/actions/runs/35830173387/job/107080979527) reported forced rather than cooperative SIGINT cleanup. Matching-runtime investigation did not reproduce it; that is not a verified fix or proof of flakiness. The older extraction also had a separate Node dispatch failure and 2-byte startup diagnostic. This replacement includes no process-code or budget changes, and neither old passing checks nor nonreproduction qualify its new head. Earlier diagnostics remain in the original PR. </details> Continues the work requested by @vyctorbrzezowski, preserving credit to @vyctorbrzezowski, @steipete, @fuller-stack-dev, @vincentkoc and @shakkernerd. ## Work sessions - [Original discussion](https://team.openclaw.ai/chat/roboclaw/dashboard/28feaf46-a23c-468e-bfad-ab44a1d5ac7b) - [Implementation and verification](https://team.openclaw.ai/chat/roboclaw/~key/subagent/949fe0ab-0f88-4056-a482-913b7f4974f4) Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: shakkernerd <[email protected]>
Related: openclaw#142863 Reworked directly on main, replacing the retained foundation from openclaw#153828. This no longer depends on the defaults PR or the held migration drafts. ## What Problem This Solves Fixes deleted groups reappearing when deletion overtakes session creation or category assignment before catalog registration settles. ## User Impact Group deletion waits for earlier committed session writes and their registration. Bookkeeping failures warn and reload the catalog instead of falsely reporting that an already-saved session write failed. Reassigning the same category can repair missing bookkeeping. Session updates retain their place in the writer queue, and closing a session database no longer hangs behind revoked cleanup waiting for that same writer. Already-admitted writes still settle before close. The catalog remains global. No agent-owned-group activation, schema change, new configuration, public RPC change, or Gateway deployment is included. Fresh creation remains isolated from unrelated archive-export failures; existing-session and alias adoption retain their historical retry and visible failure behavior. Canonical bytes, retention protection and explicit recovery are preserved. ## Why This Change Was Made Keep the original physical writer through commit settlement, existing publication and registration, with live authority checked before committing and installing results. Remove late duplicate registration and the redundant replacement wrapper. Touched durable access now uses the existing history reader, agent executor and shared-state reader. Supported aliases retain canonical replacement and native deletion custody. CI-exposed custom-store and first-creation identity defects are repaired at those existing owners; no parallel registry, writer or archive-retry manager is introduced. ## Evidence - Actual registered create/patch versus group-delete races demonstrate the original defect and its repair. Proof includes close joining, physical-path/environment changes, transaction/commit revocation, uncertain publication, native rollback and rejected/no-write suppression. - Unchanged guarded SDK suite: **24/24**. Creation/replacement/archive owners: **36/36**. Registered Gateway race/siblings: **14/14**. Reclamation repair: **73/73**, including the original board and Zalouser failures. These selections overlap earlier proof and are not combined into a larger total. - Historical adoption-triggered archive retry is restored. Real collision/recovery fixtures verify exact bytes/hash, attempts, retained transcript/metadata, publication ordering and zero host data SQL. Fresh creation and generic recovery controls remain intact. - Static dependency-cycle and test-inventory defects found by hosted CI are corrected. Architecture checks pass; both original routing suites pass **501/501**. - Fresh independent review (R3) of the complete revised candidate is **scoped-clean through P2**, with no actionable findings. It reviewed source/evidence, not an independent execution of the tests. The subsequent mechanical removal of an unreachable snapshot wrapper migrated its three test callers to the existing connection-bound kernel; final snapshot/type/lint/export/build checks cover that cutover. - A subsequent hosted-CI teardown race is repaired: read-admission retirement no longer loses an already-acquired exact lease receipt needed after native exit. A real-worker regression fails on the published predecessor and passes with the base owner and repair; this substitutes one owner, not a full baseline. **109 focused tests pass**, including original failing consumers, with core/test types and typed lint clean. Fresh independent R4 review of this two-file correction is **scoped-clean through P2**; it did not rerun tests. - The next hosted run exposed replacement callbacks losing their FIFO turn and a planning-close deadlock. Exact database locators now reserve the existing queue before worker-owned schema discovery; revocation removes only pending maintenance admissions. Unchanged original cases reproduce RED and pass after repair. Final-source ownership proof is **93/93**, with production/test types, typed lint, formatting and delta ratchets clean. Independent R5 review of the 11-file correction is **scoped-clean through P2**; tests were not independently rerun by the reviewer. A separate final integration applied the frozen repair to the actual failing CI merge `27bf437c`, including its main-side worker-runtime changes: the original config lane passed **90 files / 1,654 tests in 189.63s**, on Node 24.19.0 with two workers and retries disabled. This is local exact-merge integration, not a substitute for current-head hosted CI. **Current-head Claw review (c3860f0, September 23 at 16:52 UTC):** no actionable introduced or security defect was found. Its explicit source assessment withdraws the prior generic migration-proof request and confirms no schema, serialized representation, retention-policy or public-RPC change. The generated checklist still repeats that withdrawn request; it is not an unresolved source finding. Existing-state alias, archive-recovery, authority and lease-cleanup evidence above remains applicable. Current-head hosted CI and native merge gates remain required. **Qualified integration baseline (11cc34f):** production and all source core-test type graphs, revised-candidate typed lint, all three canonical unused-export scans, and canonical build passed. After the final mechanical cutover, creation snapshots passed **13/13**, production/session-test types and two-path typed lint passed, all three unused-export scans reported zero entries, and the final build passed in **225s**. All 48 source hashes stayed unchanged through that baseline qualification and publication. The subsequent seven-line production receipt-lifetime correction and its regression have separate focused qualification above; at that stage the other 46 paths were unchanged. The later FIFO/cancellation correction has separate proof above; no fresh full local build is claimed for it. Current-head hosted CI remains required. **Retained limitation:** the earlier full-tree core lint scan failed on unchanged `src/cron/service/timer.test.ts` (1,022 counted lines versus its 1,000-line allowance). Its Git blob is identical to the selected main base. No allowance was raised; the full changed-check wrapper is not claimed green. Earlier local proof used Node 26 versus hosted Node 24.19. New FIFO/cancellation reproduction and qualification use verified Node 24.19.0. No live-Gateway, native-platform or published-driver upgrade proof is claimed. **Unresolved timing evidence:** hosted predecessor CI observed dirty session describe at 124.39ms against its unchanged 100ms assertion (zero transcript reads; 1,995 rows still pending). One original-order attempt stopped earlier in the separate cron process on six real-HTTP delivery cases, including a 120s timeout (1,567 passed); those failures remain unexplained and were not retried. The still-unexercised 89-selector Gateway plan was then run once, with unchanged assertions: describe 32.62ms, dirty describe 15.25ms, zero transcript reads and 1,983 rows pending. The Gateway shard itself was not green: 29 failed, 974 passed, one skipped and two unhandled errors; HTTP cases observed the host secret-egress proxy refusal/502 response rather than their expected local endpoint payload. That transport boundary was not bypassed. The latency case is a non-reproduction, not a timing fix or CI waiver. Local Node 26 differs from hosted Node 24.19; no timing limit was changed. <details> <summary>Regression attribution, review dispositions and measured costs</summary> The custom-store transcript failure came from reinterpreting a prepared physical database as a logical store. Reading its already-resolved owner fixes the producer; transcript guards are unchanged. The original board deletion failure directly showed an unresolved host shared-state identity versus the worker's first-created physical identity. Restoring only the baseline deletion lookup made the unchanged test pass. The repair publishes first creation through the canonical admission owner before unchanged receipt checks, and settles errors through existing failure/termination handling. This was a narrow counterfactual, not a whole-baseline run. Board 22/22, Zalouser 5/5, reclamation custody 33/33, shared-state lifecycle 11/11 and the extended owner file 2/2 pass. The earlier Signal-alias P2 was reproduced at the actual admitted entry point and repaired. R2 alleged a newly missing original-snapshot CAS across an asynchronous creation callback. A deterministic comparison with the old entry/projection owners showed the same low-level lost-update behavior in both; newer persisted ownership survived. Normal Gateway create/patch retain the lifecycle fence and caller/session checks. That finding remains disposed as inherited, not claimed fixed; the comparison substituted two owners, not the entire baseline. The earlier archive comparison restored 22 production paths, likewise not a full-baseline run. Revised archive tests fail on the pre-repair candidate and pass after restoring the historical retry. Measured standalone test commands use the canonical repository runner with `--maxWorkers=1` (direct wrapper when avoiding dependency reconciliation): - Revised archive file: 8/8, **19.24s wall**, including 2.505s warm worker preparation; canonical/alias adoption 2.368s/2.422s; max RSS 866,692 KiB. - Earlier reclamation file: 2/2, **38.70s wall**, including 29.43s cold compilation; test bodies total 1.507s. No new test case or worker boot. The 71-case boundary batch took 96.02s. - Latest reclamation file: 3/3, **33.60s wall**, including 26.148s cold compilation; new real-worker late-receipt regression 966ms. The 106-case sibling/consumer batch took 102.29s. Neither passing uncontrolled replay proves the CI interleaving was fixed; the deterministic RED/base-owner/GREEN regression establishes the repair. - New queue-cancellation case: changed file **12/12, 31.70s wall**, cold compiler dominated; new case **1ms**. Revised replacement-worker file: **7/7, 22.74s wall**; new unkeyed shared-owner/zero-host-SQL case **1,656ms**. Final 93-case owner batch took **51.99s**. The real worker case proves schema discovery and the no-host-SQL boundary that a mocked publisher cannot. Hosted cost for these new cases is not yet available. - Creation-worker: 34.01s cold wall, including 18.074s preparation; its three alias cases total 4.011s. Prior unchanged-owner measurements: replacement-worker 14.64s, creation-snapshot 19.97s, create/category 23.58s, patch effects 2.69s, registration 24.10s, catalog 48.41s, create preparation 18.36s, atomic initialization 13.82s. One counterfactual compiler subprocess exited 139 before tests. One prerequisite retry with supported bounded compiler concurrency completed. That tooling crash remains unexplained, not relabeled as a product failure or claimed fixed. No manual CI reruns, weaker assertions, relaxed limits or modified baselines were used. The isolated exact-merge proof initially lacked workspace-local `quickjs-wasi`/Markdown dependency links; its own frozen install repaired that setup, and the single prerequisite retry passed. Shared candidate dependencies and source were not changed. 55 files, +2,477/−460: production 42 files, +1,151/−331; tests/support 12 files, +1,315/−125; owning documentation 1 file, +11/−4. Growth comes from required worker adaptation, pending-admission cancellation at the existing queue owner, and lifecycle/data-preservation proof—not another queue or presentation-module extraction. The [failed predecessor run](https://github.com/openclaw/openclaw/actions/runs/35878886549) tested merge 27bf437c (2ab085b plus main fe14430). Its sole failed test job first showed three replacement FIFO failures, then a planning-close wait cycle and teardown cascades; this is not attributed to infrastructure or waived. The accepted auto-merge request was explicitly canceled through native recovery before repair. Current-head hosted CI and native replacement recovery remain required. Historical [CI run 35670778480](https://github.com/openclaw/openclaw/actions/runs/35670778480) qualified the retired stacked head `57fecf53`, not this rewrite. The first rewritten head `92fa7c88` passed its focused local selection/build, then hosted CI exposed the defects repaired here. Neither old head's checks qualify this revision. </details> Derived from the work requested by @vyctorbrzezowski; contributor credit is retained. ## Work sessions - [Original discussion](https://team.openclaw.ai/chat/roboclaw/dashboard/28feaf46-a23c-468e-bfad-ab44a1d5ac7b) - [Implementation and verification](https://team.openclaw.ai/chat/roboclaw/dashboard/77bcdbfb-d371-44a4-b5fb-71982a391c73) - [Earlier registration implementation](https://team.openclaw.ai/chat/roboclaw/070c58af) - [Transcript and archive compatibility repair](https://team.openclaw.ai/chat/roboclaw/~key/subagent/efba26c0-af82-4536-9304-fc99efa8f5d1) - [Reclamation diagnosis and repair](https://team.openclaw.ai/chat/roboclaw/~key/subagent/b6e66b22-c1f6-4497-9a12-8a90796014e3) - [Late-lease cleanup repair](https://team.openclaw.ai/chat/roboclaw/~key/subagent/04bbd182-7274-4ed0-b7ac-63095b94a425) - [FIFO and handle-lifecycle repair and verification](https://team.openclaw.ai/chat/roboclaw/~key/subagent/95ed6726-6bcd-4cf0-88d9-608a6cd292d1) Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: shakkernerd <[email protected]>
Related: openclaw#142863 Replaces openclaw#153883; the original stays open until this fix lands. ## What Problem This Solves Selecting an existing session group named `__new-group__` opens New Group instead of assigning the session to that group. ## User Impact All group names behave as data. New Group, ordinary assignment, drag-and-drop and denied-write behavior stay intact. No appearance, permission, schema or RPC changes. ## Why This Change Was Made Mark the create option explicitly and inspect the selected option rather than reserving a group-name string. Keep the current `category-cell.ts` owner and its existing DOM guard; do not restore the earlier extraction. The two category tests move out of the oversized view test file without losing assertions, adding a colliding-name case and a positive create-action control. Production shrinks by two lines; three files total, +120/−104. ## Evidence - On main `2503f1b799d`, the real Sessions renderer regression failed for `__new-group__` while two controls passed. With the fix, all three category cases and all 51 remaining view cases pass. - Per-file `pnpm test <file> --maxWorkers=1`: category suite 2.25s wall (collision 17ms); remaining view suite 2.64s wall. [Hosted CI](https://github.com/openclaw/openclaw/actions/runs/35928486234): category test execution 0.128s (collision 48ms); remaining view tests 1.087s. - Fresh canonical changed checks passed (format, lint, typegraphs, line/assertion guards and dead exports). Independent P0–P2 review: scoped-clean, no findings. Current-head ClawSweeper review completed with no findings. Exact-head hosted CI remains enforced for landing. - Behavior-only DOM boundary proof; no live Gateway or screenshot evidence is claimed. <details> <summary>Replacement provenance and earlier CI limitation</summary> The original PR could not be safely rebased through the native ancestry-preserving publisher. Its accepted auto-merge was cancelled through native retained-outcome recovery before this authorized replacement was started from current main. No old receipt or guard was removed. The old head’s [Node small-18 failure](https://github.com/openclaw/openclaw/actions/runs/35830173387/job/107080979527) reported forced rather than cooperative SIGINT cleanup. Matching-runtime investigation did not reproduce it; that is not a verified fix or proof of flakiness. The older extraction also had a separate Node dispatch failure and 2-byte startup diagnostic. This replacement includes no process-code or budget changes, and neither old passing checks nor nonreproduction qualify its new head. Earlier diagnostics remain in the original PR. </details> Continues the work requested by @vyctorbrzezowski, preserving credit to @vyctorbrzezowski, @steipete, @fuller-stack-dev, @vincentkoc and @shakkernerd. ## Work sessions - [Original discussion](https://team.openclaw.ai/chat/roboclaw/dashboard/28feaf46-a23c-468e-bfad-ab44a1d5ac7b) - [Implementation and verification](https://team.openclaw.ai/chat/roboclaw/~key/subagent/949fe0ab-0f88-4056-a482-913b7f4974f4) Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: fuller-stack-dev <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: shakkernerd <[email protected]>
Current cleanup status — September 23
The agent-owned group migration remains deferred; this PR stays a draft. The earlier replacement-stack list below is historical.
Smaller PR stack — in progress
This combined draft is being split for review; do not merge it as one large PR. The existing branch and contributor history are retained until the replacement stack is verified.
refactor: retain session ownership during post-commit work #153828 — storage commit-continuation foundation (7 files; no schema, Gateway, or UI activation).
refactor: isolate Doctor migration preparation #153848 — Doctor migration preparation (4 files; based on refactor: retain session ownership during post-commit work #153828).
refactor: isolate session mutation preflight #153860 — Gateway mutation preparation (8 files; based on refactor: isolate Doctor migration preparation #153848).
refactor: isolate sidebar group dialogs and child traversal #153870 — sidebar/dialog preparation (4 files; based on refactor: isolate session mutation preflight #153860; 22 hosted browser cases passed).
fix: distinguish session group names from the create action #153883 — Sessions-page/view preparation and strict CI repair (9 files; based on refactor: isolate sidebar group dialogs and child traversal #153870; repaired guards/browser/CI-artifact evidence passed; one Node CI failure remains held).
refactor: isolate mock session-group fixtures #153894 — mock-fixture/catalog-test partition (4 files; based on fix: distinguish session group names from the create action #153883; exact-head CI and 27 hosted browser cases passed).
refactor: prepare legacy session-group source reads #153928 — passive legacy-index/receipt adapter (2 files; based on refactor: isolate mock session-group fixtures #153894; HELD for SQL-boundary and production-consumer repair; no activation).
refactor: centralize session-group defaults replacement #154017 — active defaults-snapshot replacement (2 files, +45/−1; based directly on refactor: isolate mock session-group fixtures #153894, independent of held refactor: prepare legacy session-group source reads #153928; exact-head CI and 22 named hosted regression cases passed).
fix: prevent deleted session groups from reappearing #155288 — retained global registration custody (14 files, +781/−256; based on refactor: centralize session-group defaults replacement #154017; exact-head CI passed, with all 17 named create/category and registration-worker cases executed successfully).
refactor: separate session group membership reads from catalog writes #155306 — active global membership-reader extraction (7 files, +41/−42; based on fix: prevent deleted session groups from reappearing #155288; identical resolver and all current consumers; exact-head hosted CI and all 50 named cases passed, independent P2 review scoped-clean).
The passive inventory and planner drafts remain unpublished until their real activation consumer is present. The remaining core/bundled-web cutover is being reconciled against this stack and current main; dormant code is not an independently landable layer. No scoped behavior is activated by these preparations.
Related: #142226
What Problem This Solves
Fixes: custom session groups appear under other agents, and changing a same-named group can change another agent’s organization.
User Impact
Each agent gets independent group names, defaults, ordering, and mutations, including empty groups and identical names. The Control UI keeps the existing roster layout and personal empty-group visibility choices. Web and native actions retain the agent and connection that initiated them.
Migration: shared state advances from schema 17 to 18; agent-store schema stays at 21. Legacy groups used by several agents become independent catalogs. Empty legacy groups move to the configured default agent. Existing session contents and timestamps are preserved. Doctor backs up and verifies the source before committing catalog data and its receipt; unsafe or incomplete sources are refused rather than treated as empty.
Older Gateways remain usable for chat and ordinary session actions, but native group management—including category changes—requires the agent-scoped capability. Legacy client preferences keep their original destination and stable import receipt across retries; uncertain acknowledgements retain the source without blocking canonical catalog reads.
Why This Change Was Made
The previous hide-empty revision was only a visibility mitigation. This replaces it with one Gateway-owned catalog keyed by agent and name, owner-scoped RPCs and events, and scoped client projections. It removes global catalog writes and client-side member rewrite loops instead of hiding foreign groups. It uses the existing shipped-updater compatibility path; actual upgrade qualification remains a separate gate.
Requested by @vyctorbrzezowski. The original contribution remains credited in this branch’s history; the accepted refactor and landing direction are recorded in the linked work session.
Work sessions
Evidence
Implementation candidate; qualification is still in progress. This is not a merge-ready claim.
Required before landing: exact-head hosted CI and Apple tests; actual published-driver upgrade cells against the clean candidate; new inspected before/after ownership screenshots delivered in the originating chat and embedded here with verified rendering. The superseded visibility-only screenshots are intentionally not presented as proof of ownership.