Repository navigation
refactor(sessions): complete SessionManager actor admission for incognito (P7a, inactive) - #164869
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.
|
🦞👀 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, 7:50 AM ET / 11:50 UTC (Revision 4). ClawSweeper reviewWhat this changesSessionManager, OpenClaw’s conversation transcript manager, gains inactive incognito actor routing for reads and writes, preserves acknowledged results after later failures, and propagates actionable incognito refusals. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this remains useful inactive preparation, and no introduced correctness or security defect was found. The prior migration blocker is unsupported by the actual storage delta; CI remains red with separately documented inherited-failure evidence. Likely related people: @steipete, supported by recent merged session-persistence and incognito work. Priority: P2 Review scores
Verification
How this fits togetherSessionManager turns agent messages and transcript mutations into stored conversation history and loaded views. This branch prepares those operations to use the existing per-agent incognito worker while production continues using its current host owner. flowchart TD
A[Agent messages and mutations] --> B[SessionManager]
B --> C{Captured incognito actor}
C -->|Absent| D[Existing host owner]
C -->|Present| E[Incognito worker]
E --> F[Live authority and SQLite transaction]
F --> G[Committed receipts]
D --> G
G --> H[Transcript views and publications]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +783, Tests +685, Docs +25, Other +1. Total +1494 across 51 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Preserve this staged composition under the existing actor owner, with production activation and removal of native arms completed together in the dedicated cutover. Do we have a high-confidence way to reproduce the issue? Not applicable to this staged refactor. Source inspection and supplied production-boundary results establish the actor scenarios; this read-only review did not execute tests. Is this the best way to solve the issue? Yes: reusing the existing metadata backend and hydration owner avoids competing persistence implementations while preserving the released synchronous compatibility path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ee5350712981. 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
History |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…nito (P7a, inactive) (openclaw#164869) * 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): extract shared SessionManager write contracts * refactor(sessions): complete inactive incognito actor admission
What Problem This Solves
SessionManager still requires a native database admission, preventing its incognito operations from running entirely on the per-agent actor. Some replay and extension adapters also turn actionable synchronous incognito refusals into absence or apparent success.
Solution
Two feature commits extract the shared SessionManager wire contracts into a leaf module, then compose actor admission, metadata, receipts, compaction, suffix/rewrite, branching, and refusal propagation. All contract importers move directly; there is no re-export shim.
The actor reuses the existing connection-bound metadata backend on its single database connection; hydration and maintenance reads use the shared P7c reader. Planning happens outside transactions, authoritative rows are reread in synchronous worker transactions, and current host authority is checked at transaction and commit. Acknowledged facts publish through their existing owners even when later authority, observer, or projection work fails. Accepted writes retain FIFO custody through close; an unknown outcome never triggers replay or native fallback.
The projection-grant failure came from checking a claim while its published facts were deliberately pending. The existing compute owner fences that claim before dispatch and after settlement; the redundant assertion was removed from the grant without adding SQL or blocking work there.
Impact
Production routing stays INACTIVE and host-owned. P7d must install the actor binding and remove the native arms atomically. This changes no schema, durability, retention, configuration, update behavior, or environment names. T1 is unchanged: 902 → 902 against main
bb9f63c75069bc2522f09b441d5ec93524ab6efe.Production diff: +1,284 / −501 / net +783 (1,785 changed lines). P6 (#164727) and P7c (#164819) have merged; this branch merges main without rebasing and targets
main.Activation follow-up: conditional worker-turn grants retain pre-existing indexed placement-authority reads from another owner (
src/gateway/worker-environments/worker-turn-launcher.ts:439,:444;placement-turn-claims.ts:422;placement-row-codec.ts:122). The same-owner read inworker-turn-transcript-target.ts:28must be routed before P7d activates the cloud actor path. Boundary proof covers the operations moved here; it does not claim these existing authority reads disappeared. Static-note preparation conservatively refuses any secret-registry revision drift, including an unrelated registration, and must be repeated outside the transaction.Sibling/overlap context: merged P7c owns general hydration and pending-input history/interruption; SessionManager reuses its hydration owner, and the redundant P7a maintenance-read command has been removed. P7b owns Board/ACP/outbox/lifecycle composition. Incidental overlap with RoboClaw #162433 is limited to the required ownership changes.
Inactive-export exception (removed by P7d)
P1–P6 have no false-valued route predicate: inactivity is the absence of production actor selection. Two exact export-level
@internalannotations therefore suppress only production Knip findings:withSessionManagerIncognitoActorandIncognitoSessionSyncAccessError. P7d removes each annotation when installing its real runtime caller or sync-refusal preflight. The full-tree Knip scan still audits both exports against their test consumers; no file-wide suppression or route activation was added.Evidence
Validation is bound to the integrated candidate tree
12c7ebb1862f6e96822c21b9e94d12ea53be7472against mainbb9f63c75069bc2522f09b441d5ec93524ab6efe.--maxWorkers=1. This includes exact committed interruption-ID recovery after a lost ordinary reply, without replay.--maxWorkers=1.node scripts/check-changed.mjs --staged --base bb9f63c75069bc2522f09b441d5ec93524ab6efe: passed, 2,631.33 s wall, against the fully staged merge result. Includes all typecheck groups, production/full-tree/script Knip (zero findings), formatting, lint, guards, and the SQLite worker ratchet (no T1 growth against the pinned base).pnpm build: passed, exit 0, onblacksmith-testboxleasetbx_01m437g72r12yv3rmb0zmtt6d4, run 37195647316. Exact candidate tree and source bytes were verified before execution. Build phases totaled 494.0 s, the delegated command including source/dependency preparation took 668.47 s, and the wrapper took 1,318.97 s end-to-end. The lease is stopped (completed). One earlier tooling attempt exceeded the shell argument limit before build execution; the smaller verification payload fixed that failure. The backing Actions run may show cancellation from one-shot lease cleanup; the delegated build succeeded.The full build runs the Control UI performance check in report-only mode. It reported startup JS gzip 373,481 B vs 373,454 B (27 B over). This PR changes no Control UI executable inputs, UI build configuration, dependencies, or budget files. Build provenance affects emitted bytes; no matched baseline reproduction was run, so the cause remains unconfirmed.
Prior-to-integration proof includes 64 focused tests (644.93 s), 12 actor/real-close tests (602.19 s), 29 import/build-graph tests (766.13 s), the wrapper inventory test (70.03 s), and a passing full build on Testbox run 37192165773, whose lease stopped after success. The earlier full implementation and the narrow annotation delta both received clean P2 reviews. These are retained as prior-source evidence, not substituted for the integration checks above.
Focused-test wall times are local measurements on the loaded host; PR test CI timing is not yet available. Production activation remains a separate PR.
Landing verification
The released SDK source was checked against
v2026.9.8: public SessionManager sync/async signatures remain unchanged by this PR, and no changed helper is exposed throughapi.runtime.*or a documented SDK subpath.SessionManagerWriteAdmissionis reachable in generated declarations only through an inherited protected persistence method; the released and currentSessionManagerconstructors are private, so this is not a callable or subclassable plugin contract. Actor callbacks and the moved incognito error are unreleased internals. The integrated SDK report's 131 reachable declaration changes are retained as evidence; zero direct-signature changes alone was not used as a compatibility claim.The report-only UI gzip overage also occurs on main: scheduled CI run 37192694630, build job 111408171333 at
6f556a72ba112c8602bafa5494babe71ba2a7f87reports 373,499 B against the same 373,454 B budget. This candidate reports 373,481 B, 18 B less. This is hosted baseline comparison, not a same-toolchain rebuild of both revisions.ClawSweeper completed the exact-head review at 2026-10-04 10:58:33 UTC with no correctness or security findings. Its automatic data-model marker names
session-manager-persistence-entry.ts; the change there extracts the existing message-adoption code unchanged frompersistRecord, operating on an already committed snapshot. No serialized storage format, schema, or data migration changes. Existing native/durable compatibility and actor reopen tests cover the retained behavior. The review's technical assessment likewise states that no stored-data model changes require migration proof.CI UI failure investigation
Initial CI UI shard 4 job 111420120229 failed
login-gate.e2e.test.ts/ “keeps generic help collapsed until requested when there is no failure” withMissing mounted login gate. Five single-worker full-file replays on head9145490181643a97e1e26596e67d62d718347887and five on merge basebb9f63c75069bc2522f09b441d5ec93524ab6efeeach passed all 25 cases. Head wall times: 78.30, 64.29, 73.32, 87.66, 80.39 s; base: 106.95, 69.38, 71.79, 84.40, 55.31 s.The fixture, UI owner, bootstrap, Gateway client, and UI config bytes match between revisions. A suspected fixture race remains:
mountLoginGate(null)stops the Gateway and clears its error, awaits one Lit update, then queries the gate while pending application startup can render the connecting splash instead. This helper behavior predates the PR (19e87bf). Four recent scheduled main UI shard-4 jobs passed, so this is not proven inherited main-red. Classification: non-reproduced intermittent fixture/setup failure, with the precise trigger still uncertain. No assertions or source changed. The authorized single-job rerun passed (job 111424407515); no source fix is claimed.CI Node failure: independently inherited from main
CI run 37196672301 attempt 3 remains failed only for Node compact-small-14 and its aggregate gate. The exact tested merge is
b73150e7c2151225e27332b0d87da98b7500ff24, with ordered parents main979466250d54290e42945acc1ad42923c465b8c1and PR head9145490181643a97e1e26596e67d62d718347887. The UI rerun and every other selected job passed; no jobs were cancelled.The failure is
run.recovery-deadline.test.tssuite warmup: “real workspace consumer was exercised: expected 0 to be greater than 0.” The underlying error isSqliteWorkerError: Agent admission requires its host owner. Main commit e95e11c (#164779) made run admission awaitreadSessionEntryInWorkerbefore workspace discovery; the existing embedded Vitest thread cannot acquire the host-only admission insqlite-worker-store.ts:207–210. The guard's finally assertion masks that earlier refusal. The failing fixture, async admission owner, and host-only guard are unchanged by this PR. Fourteen relevant source/config blobs match between the main parent and the CI merge.Controlled proof: the exact four-file CI group with CI=true, Node 24.21.0 and two workers passed 69/69 on the PR head. It failed identically on clean main
9794662(65 passed, 4 skipped) and on the exact CI merge (65 passed, 4 skipped, 148.52 s wrapper wall). Clean current mainf8f1c8af73a7b874db7c2693345e41a8a6033713also fails the same focused file (4 skipped, 104.22 s Vitest). An additive diagnostic catch exposed the original error while retaining every assertion, then was removed byte-for-byte. Earlier five single-worker passes on the PR head and five on its merge base missed the 15 newer main commits incorporated by CI. Recent scheduled-main CI predates this upstream change.No PR source or assertions were changed. The explicitly authorized inherited-failure admin exception retains this red CI result and the incomplete deadline-case coverage; it does not relabel CI as green or waive security/review gates. Production incognito routing remains inactive.