Repository navigation
refactor(sessions): compose board, ACP, outbox and lifecycle on the incognito actor (P7b, inactive) - #164883
Conversation
Preserve shared ACP metadata persistence and sequencing while preparing actor entry commands, transaction-local controller guards, board snapshots, and shared idle-pin lifetime. Keep production host-owned until P7 and document the remaining synchronous SDK and caller cutover requirements. Validation: 44 tests passed with one platform skip on isolated Linux; four pre-fix negative controls reproduced missing pins, grant reentrancy, and revoked-policy persistence. Changed-file checks, database-worker ratchet, zero-cycle checks, and Codex review through P2 passed. T1 remains 915; no new environment names.
Merge current main to consume the Doctor-owned ACP migration contract. Keep P6 inactive, remove retired runtime legacy-key and cleanup calls, consolidate ACP composition in its existing mutation owner, and complete the compiled wrapper dependency inventory. Preserve entry-before-metadata ordering and update the focused sequence proof.
Merge main to include its suppression-inventory fix. Expose ACP operations through the inactive actor borrow, retaining the full lazy-load and operation promise before any await. Extend the nested-grant regression to both ACP methods; the unguarded binding fails this control. Document intentional model-mock isolation without expanding its baseline. Production incognito routing remains native until P7.
Merge main CI ratchet fixes and move shared ACP input/result shapes into a leaf contract. Remove static implementation-type cycles while preserving lazy runtime loading inside actor custody. Production incognito routing remains inactive and released Plugin SDK call signatures remain compatible.
Prepare captured actor bindings for Board, ACP, reports, outbox and lifecycle while production routing remains host-owned until atomic activation. Preserve current grants, receipt settlement, FIFO and existing durable contracts. Keep host lifecycle composition outside standalone worker import graphs. Reuse the existing current read-only path for runtime journal checks on workers and the main CI baseline reader repair from 06131c4.
Keep default production routing host-owned while the explicit actor binding reuses the existing reader. Retain lifecycle callback receivers and distinguish deletion plans during reclamation.
|
🦞👀 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. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 4, 2026, 11:56 AM ET / 15:56 UTC (Revision 10). ClawSweeper reviewWhat this changesThe branch connects private-session Boards, external-agent metadata, transcript reports, queued turn records, and lifecycle operations to the existing database worker while leaving production activation separate. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains The PR remains useful and has no concrete blocking finding. The completed SDK comparison satisfies the previous review’s remaining request; the broader ownership draft does not supersede this focused stage. Priority: P2 Review scores
Verification
How this fits togetherIncognito sessions hold private conversation data in a process-lifetime SQLite database. These adapters carry session operations and current authority into its worker, then publish committed results to existing product owners. flowchart TD
A[Session operations] --> B[Captured actor and session]
B --> C[Current authority checks]
C --> D[Database worker queue]
D --> E[Existing SQLite operations]
E --> F[Commit receipt]
F --> G[Session facts and notifications]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +790, Tests +619, Docs +45. Total +1454 across 28 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep this preparation inactive, preserving existing storage and SDK contracts until the separate activation stage completes the caller cutover. Do we have a high-confidence way to reproduce the issue? Not applicable to this internal refactor; the captured failing controls and worker/Gateway boundary results support its preserved contracts, without reviewer-side execution. Is this the best way to solve the issue? Yes. The branch extends existing facades and SQL owners, retains released callable contracts, and leaves activation to the planned atomic cutover. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 68ebe61752ed. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
Resolve the Gateway close-test conflict by retaining both the incognito outbox regression and main mention/involvement settlement proof. Keep the released ACP read and metadata-write signatures unchanged; internal actor helpers retain the inactive P7b composition. Add a type contract check for both released signatures.
Keep actor bindings on the existing internal ACP owners. Preserve the released SDK reader as a typed identity export and retain one-argument manager injection callbacks. Record the active compatibility contract and cover the callable shapes with type assertions.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge current main, including P7a, without rebasing. Preserve both the agent-end and ACP compatibility records. The combined actor, ACP, Board, outbox, lifecycle, SDK, and import-boundary replays pass. The missing-session autoreview finding was rejected against the existing reader and its passing regression: valid missing keys retain a result object with an undefined entry.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ades Route explicit actor targets through the existing host deletion and cleanup owners so the composition is production-reachable without importing host hooks into standalone worker graphs. Preserve ordinary lifecycle arguments and inactive routing. Give the multi-owner lifecycle fixture its documented three broker slots, and await cron fixture database retirement before reopening.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Integrate main bb5656b, including the chat-admission and current-authority repairs from #164682. The merge is conflict-free and keeps P7b production actor routing inactive. Preserve the ACP facades' existing empty-key null/no-op results when an actor binding is supplied, and retain trimmed reader keys without turning valid missing entries into null. Empty mutations never invoke their mutator. The released one-argument SDK contracts remain unchanged. The read, write, and normalization controls failed before repair. Actor and native reader suites passed 16 tests, and actor/native writer suites passed 20 tests. Fresh P2 review against the integrated main base is clean.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…ncognito actor (P7b, inactive) (openclaw#164883) * feat(state): prepare incognito ACP ownership (P6, inactive) Preserve shared ACP metadata persistence and sequencing while preparing actor entry commands, transaction-local controller guards, board snapshots, and shared idle-pin lifetime. Keep production host-owned until P7 and document the remaining synchronous SDK and caller cutover requirements. Validation: 44 tests passed with one platform skip on isolated Linux; four pre-fix negative controls reproduced missing pins, grant reentrancy, and revoked-policy persistence. Changed-file checks, database-worker ratchet, zero-cycle checks, and Codex review through P2 passed. T1 remains 915; no new environment names. * refactor(sessions): compose inactive incognito actor operations Prepare captured actor bindings for Board, ACP, reports, outbox and lifecycle while production routing remains host-owned until atomic activation. Preserve current grants, receipt settlement, FIFO and existing durable contracts. Keep host lifecycle composition outside standalone worker import graphs. Reuse the existing current read-only path for runtime journal checks on workers and the main CI baseline reader repair from 56e946d. * refactor(acp): route incognito reads through the async facade Keep default production routing host-owned while the explicit actor binding reuses the existing reader. Retain lifecycle callback receivers and distinguish deletion plans during reclamation. * fix(sessions): capture actor inputs and preserve Board grants * fix(acp): retain released metadata callable boundaries Keep actor bindings on the existing internal ACP owners. Preserve the released SDK reader as a typed identity export and retain one-argument manager injection callbacks. Record the active compatibility contract and cover the callable shapes with type assertions. * fix(sessions): expose inactive lifecycle composition through host facades Route explicit actor targets through the existing host deletion and cleanup owners so the composition is production-reachable without importing host hooks into standalone worker graphs. Preserve ordinary lifecycle arguments and inactive routing. Give the multi-owner lifecycle fixture its documented three broker slots, and await cron fixture database retirement before reopening.
What Problem This Solves
Incognito Board, ACP, report/outbox, and lifecycle operations need a complete actor path before P7d can activate worker routing and remove the native branches.
User Impact
P7b remains inactive. Production does not supply captured actor bindings or tagged lifecycle targets. P7d owns activation and native-path removal. Worker failure never selects a native fallback. Schemas, stored formats, retention, durability, configuration, and existing durable routing are unchanged.
Released ACP readers and manager injection callbacks keep their one-argument signatures and Promise results. Empty ACP keys retain the existing null/no-op behavior without invoking a mutator; valid keys are trimmed, and a valid missing key still returns a result object with
entry: undefined.Why This Change Was Made
Board, internal ACP, transcript-report, outbox, and lifecycle facades accept explicit captured actor bindings and reuse existing worker commands and synchronous SQL kernels. They retain FIFO, live transaction/commit authorization, and acknowledged-fact publication. Board change collection spans its transaction. Lifecycle hooks prepare outside the transaction, settle companions from the receipt, and retain both actors during a fork. Existing host facades own deletion and artifact cleanup; their ordinary native/file inputs retain their safeguards.
Repository cleanup reads committed actor facts (
src/config/sessions/session-accessor.sqlite-deletion.ts:482,:502), and the Board actor branch bypasses native session-existence reads (src/boards/sqlite-board-store.ts:185). The deletion-journal adjustment is worker-only (src/state/agent-deletion-journal.ts:337); it preserves live shared-state fencing without repeated inspection subprocesses. The callback audit found no new host SQL or same-owner refusible read in the changed actor paths, and no concrete retained other-owner host SQL debt introduced by this composition. Caller-provided authority callbacks remain their owners' responsibility.Main was merged without rebasing, most recently at
bb5656bf89e230bb3d6c9040b1e9b86df0306439. This includes P7a (#164869), P7c (#164819), and the current chat-admission repair (#164682). Both competing Gateway shutdown tests and compatibility records were preserved. The umbrella #162433 overlaps this work; P7d remains the activation owner. There are zero new environment names and no T1 call-count growth. This inactive stage claims no production main-thread SQL reduction.Released SDK audit
Changed signatures were checked against latest release
v2026.9.8, SDK exports,api.runtime, and documented subpaths. The ACP reader uses a typed identity export, preserving runtime identity and its released one-argument type. Both manager injection callbacks explicitly retain one argument. Public deletion/cleanup SDK wrappers construct existing native inputs and do not expose internal actor targets. The activeacp-session-metadata-released-signaturescompatibility record and type assertions preserve those supported contracts without a migration or warning.The final full SDK comparison of
55ce0bbbagainst integrated mainbb5656bfpassed locally in 1121.24 s: zero added/removed entrypoints, zero direct export declaration changes, and 161 conservative reachable declaration-closure changes. Acknowledgement digest:5796b172. Reachable closure records are not changed public signatures.Evidence
Candidate:
55ce0bbbcccc4065b98ce4d614cbc1f41312c4c1. Fresh full P2 review against integrated main is scoped-clean, with no accepted/actionable findings. The review's empty-key finding was fixed with failing controls and regressions; its earlier suggestion to return null for valid missing entries was rejected against the existing contract.--maxWorkers=1, 757.34 s wall time5796b172; 1121.24 sThe Linux replay used standalone clean checkouts pinned by tree and parents, Node 24.21.0, pnpm 12.5.1, SQLite 3.53.4, four CPUs, two UI workers, literal
CI=trueandGITHUB_ACTIONS=true, and the same-revision harness. Both source trees remained clean. The Testbox lease is stopped. This is focused proof, not a replacement for the enforced PR CI/security gates.Import proof explicitly includes
test/scripts/runtime-process-build-graph.test.ts,src/auto-reply/reply/get-reply.imports.test.ts,src/state/openclaw-state.worker.imports.test.ts,src/config/sessions/session-history-read.imports.test.ts, andsrc/worker/worker.runtime-imports.test.ts. Earlier unchanged proof also covers the wrapper inventory, Knip, broker capacity and cron retirement owners. These integration tests protect actual worker/SQLite authorization, FIFO, commit publication, revocation, cross-agent lifetimes and shutdown settlement that helper mocks cannot establish.CI failure disposition
Fresh candidate CI run 37213373361 passed: 96 successful jobs, 21 skipped, including both real-Gateway UI shards and
openclaw/ci-gate. No inherited-failure CI bypass is needed for this head. Historical run 37203352452, attempt 3, had 90 successful jobs, 21 skipped jobs, two root failures and its downstream gate. Its failures are not reported as passing coverage.sessions.dispatch.demand.test.tssuppliesgetManybut omitsprepareRuntimeRefresh. Realsessions.sendreacheswithRestartSafeChatPlacementand fails before dispatch withWorker placement admission reader is unavailable; retry.Both cases fail identically in five candidate and five integrated-main runs. All 14 traced fixture/owner/config/workflow/package inputs are byte-identical. Scheduled main independently fails the same cases: run 37208805289, job 111455705607. Any native inherited-failure exception must still bind the fresh exact-head CI attempt and tested merge.ClawSweeper completed its exact-candidate review at 2026-10-04 15:36:59 UTC with no concrete correctness/security finding. Its request to record the SDK comparison is satisfied above. Its generic migration warning is rejected against the unchanged schema/kernels and its own detailed source review, which confirms no stored-data contract change or migration prerequisite.