Repository navigation
refactor(sessions): bind incognito actors for production acquisition (P7h1, inactive) - #165525
Conversation
Wire inactive creation, entry patches, SessionManager and Codex reads through one captured actor binding. Preserve transaction predicates, current authority, native commit receipts, publication ordering and accepted settlement. Keep production routing host-owned and T1 unchanged at 887.
Apply the exact shrink-only baseline corrections from 1ae6fa1. No production or test code changes.
|
🦞👀 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 October 5, 2026, 7:10 AM ET / 11:10 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR shares a captured incognito worker binding between session management and Codex history, rejects synchronous actor access before side effects, and preserves registered worker error identities. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful prerequisite absent from current main. The integration resolves the previous conflict blocker, and no introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s session subsystem stores conversation history and supplies context to agents and bundled plugins. This inactive preparation lets session managers and Codex history readers retain the same ephemeral database owner across asynchronous work. flowchart TD
A[Session target] --> B[Captured actor binding]
B --> C[Session manager]
B --> D[Codex history reader]
C --> E[Worker admission and FIFO]
D --> E
E --> F[Ephemeral SQLite]
F --> G[Validated context and commit facts]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +169, Tests +149, Docs +36, Other +1. Total +355 across 25 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one captured actor owner across acquisition and settlement, preserve released host behavior, and activate production routing only with the complete adapter cutover. Do we have a high-confidence way to reproduce the issue? Not applicable to the inactive refactor as a whole; the error-identity subfix has a recorded real-worker failing control and after-fix assertion. Is this the best way to solve the issue? Yes: sharing the existing actor lifetime and extracting unchanged admission logic avoids competing ownership while preserving the host route. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2795ad9d0e03. LabelsLabel 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 (1 earlier review cycle)
|
|
@clawsweeper re-review Integrated main in merge commit 0b33096. The sole conflict reused main's pending-history settlement helper from 17e945f and removed this branch's duplicate. Production routing remains inactive. The worker transport change preserves registered error identity; it changes no database schema or stored format, so no data migration is required. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…(P7h1, inactive) (openclaw#165525) * refactor(sessions): prepare shared incognito actor binding Wire inactive creation, entry patches, SessionManager and Codex reads through one captured actor binding. Preserve transaction predicates, current authority, native commit receipts, publication ordering and accepted settlement. Keep production routing host-owned and T1 unchanged at 887. * fix(sessions): frame incognito entry commit receipts * fix(ci): sync inherited source ratchet baselines Apply the exact shrink-only baseline corrections from d25126d. No production or test code changes.
What Problem This Solves
The final incognito worker activation needs one actor binding shared by SessionManager and Codex. Separate binding scopes can lose the captured owner between acquisition, later manager calls, history reads, and cleanup. Synchronous SDK persistence must reject actor access before SQLite, detached-view mutation, or tool-result hooks.
Why This Change Was Made
Introduce one captured actor binding and retain it on SessionManager. Validate the physical namespace before yielding, retain accepted work through settlement, and refuse synchronous persistence before side effects, including a later retarget to durable storage. Codex captures the awaited reader through its existing SDK subpath and retains the actor through scan, consumption, validation, and cleanup. Extract the pure transcript-context reader factory to preserve the lazy import boundary.
Move actor grant validation into the admission module. Reuse the pending-history settlement owner already extracted on main by
17e945fb8220. The session-facts owner retains authority, FIFO, revision, and publication decisions; its implementation is now 667 physical lines, below the 700-line guard.Preserve registered error identity across ephemeral worker failures even without a durable state context. The regression strengthens an existing real actor read to assert
SessionCanonicalKeyMigrationRequiredError, using the same worker invocation and fixture. With the old transport it fails because only the error name/message survive.User Impact
P7h1 remains inactive. T1: 883 → 883. Production acquisition stays host-owned. Native routes remain; activation must install the binding together with the remaining adapters. No schema, persistent cache, worker service, retention, durability, permissions, expiry, configuration, update behavior, or new
OPENCLAW_*names.Public creation, generic entry patches, and framed entry receipts are deferred to P7h2. This PR contains only their shared prerequisite and does not claim the final actor-bound Gateway creation flow.
Production delta against integrated main: +352 / −183 / net +169, across 25 implementation/test/doc/inventory files. Main is integrated by merge commit
0b330965bf6d27f2c59fbe5ecbd9445ff3a48ea6with parente8915f68f3cb87cffb90fc7e7799a2d70edeb45e; the original branch ancestry is preserved for the stacked P7h2 child. The sole conflict was the duplicate pending-history helper extraction; main’s existing owner is retained. The two former baseline corrections are now already on main. Related prerequisites: #164869, #164883, #164819, #165134. Parallel overlap remains P7i/P7j and the non-active umbrella draft #162433.Evidence
Historical pre-integration runtime, build, and SDK evidence below is bound to
200160789425; the baseline-only follow-upbd77e156ebc1changed no production or test code. Current integration evidence follows separately.pnpm test ... --maxWorkers=1(1,844.83s command wall time). This includes zero caller-thread SQL assertions, real server close order, the canonical worker-error regression, and the required shared-registry/import-closure suites. CI seconds are not yet measured; the error assertion reuses the existing read and fixture.scoped-cleanagainst the pinned integration base, with high reasoning and--codex-speed ultrafast. The worker ratchet passed against the pinned integration base (29.67s).reachable, spanning two changed declaration modules. The 128 exports listed by that report retain their direct declarations and kinds; separately, the existingcodex-session-transcript-runtimesubpath adds the exportedcaptureCodexSessionContextReaderacquisition helper. The command passed in 1,626.85s. Digest:da155ccb348d9b79ee257fa07fe81383aa9cba07f64c7b8c8cdedea02ae3b7d5.pnpm buildpassed in 589.09s on Blacksmith Testboxtbx_01m45f70asnc79x3hzawya4q7b, with all 25 changed-file hashes verified before execution. Remote run. The initial changed-file check stopped on inherited stale baselines: the removed Telegram fetch max-lines entry and environment-name budget 469 versus the verified count 464. Both exact shrink-only fixes from1ae6fa18f759are included and have a separate clean P2 review. The corrected local check passed every preceding guard and typecheck, plus core lint, then its extension-lint prerequisite hit a 300-second SDK declaration-build tooling timeout. The completenode scripts/check-changed.mjs --base d7f9ebd8de66effa1fd71d4b0556497f03909b4f --timedthen passed at final headbd77e156ebc1on an isolated Hetzner Crabbox in 3,118.83s. The runner fetched and verified the exact pushed commit before/after execution and used the repository CI toolchain/containment helpers. This includes extension lint and the final database/import/security-boundary guards. No production or test source changed between that runtime/build/SDK proof andbd77e156ebc1.test/vitest/vitest.database-worker-core-paths.mjs; SessionManager, Gateway, and the Codex extension tests already use their host-owned fork projects. The transport regression stays in the existing routed incognito session suite.Integration validation
At
0b330965bf6d27f2c59fbe5ecbd9445ff3a48ea6:scoped-clean, no actionable findings. Formatting andgit diff --checkpassed.--maxWorkers=1: 112 tests in 12 files passed. The first run covered actor sessions, SessionManager, SDK refusal, Codex history, real Gateway close order, wrapper inventory, runtime build graph, and import closure (68 tests, 757.30s wrapper wall time). The supplemental run covered pending-history settlement, actor history, SDK metadata admission, and the P7f1 snapshot races (44 tests, 448.90s command wall time; 447.83s wrapper time). The exact-head CI workflow passed 60 jobs and skipped 23; successful jobs consumed 10,774 aggregate job-seconds (whole selected workflow, not the marginal cost of these tests).e8915f68f3cb→0b330965bf6d): zero entrypoints added/removed, 128 reachable changes, and zero direct declaration/kind changes among those reported exports. This does not mean zero additive SDK exports:captureCodexSessionContextReaderis newly exported on the existing subpath. Report digest:929303a592dfeedb89874463fdbac9fe9b32bceb28cc85113b749e187e05a4d3.v2026.9.8: existing context read and validation signatures remain synchronous and source-compatible; the captured reader is additive. Existing deprecation records remain applicable. No newOPENCLAW_*name is introduced.The previous context/evidence check failed because the body used
Probleminstead of the template’sWhat Problem This Solvesheading. This body corrects that metadata defect without changing source; the replacement context/evidence run passed. The exact-head CI workflow also passed its aggregate check.