Repository navigation
refactor(sessions): wire incognito creation and entry patches to the shared actor binding (P7h2, inactive) - #165628
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.
Preserve captured actor and source authority through creation, entry patches, framed commit receipts, publication, and cleanup. Production remains host-owned pending atomic activation.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 5, 2026, 3:38 PM ET / 19:38 UTC (Revision 8). ClawSweeper reviewWhat this changesRoutes explicitly bound incognito session creation and entry updates through the shared worker actor, including transcript initialization, owner assignment, authority checks, and committed-result publication. Merge readiness✅ Ready for maintainer review The prior CLI-history blocker is resolved, with no remaining actionable findings. This PR still supplies useful inactive wiring absent from current main; the merged prerequisites do not supersede it. Priority: P2 Review scores
Verification
How this fits togetherIncognito sessions hold private conversation state in a process-local database. Session creation and update requests pass through a captured worker actor, which validates authority, commits changes, and publishes acknowledged facts to callers. flowchart TD
A[Session creation or update] --> B[Captured actor binding]
B --> C[Prepare session facts]
C --> D[Current authority and row checks]
D --> E[Worker transaction]
E --> F[Native commit receipt]
F --> G[Publish facts and notify callers]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +862, Tests +724, Docs +24. Total +1610 across 22 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep creation and patches on the existing actor and mutation owners, with production activation handled by the separately reviewed atomic cutover. Do we have a high-confidence way to reproduce the issue? Yes for the prior blocker: capture an actor transcript watermark, append another message, then attempt writer adoption with the stale guard. The contributor reports the intended pre-fix failure and after-fix rejection; this reviewer inspected the path without executing it. Is this the best way to solve the issue? Yes. Forwarding the existing guard into the shared transaction-local kernel restores the established invariant without adding another validation owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0ac81cf6ec1a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Merge current main to retain the landed session authority, history, Memory, and lifecycle settlement owners. Keep creation and generic entry patches on the explicitly captured actor binding; production remains host-owned and inactive.\n\nConflict resolution reviewed through P2 with no actionable findings. Production types, formatting, import cycles, runtime build graph, and compiled-wrapper closure checks pass; focused runtime and test-type proof continues before publication.
|
@clawsweeper re-review Integrated current main with merge commit 5d02534, preserving the merged parent owners and inactive production route. All 176 focused tests, production types, 27 test type graphs, Madge, formatting, core lint, and fresh P2 autoreview pass. The PR body records the integration and released SDK evidence. |
|
🦞👀 Re-review progress:
|
Forward the prepared CLI admission and watermark to the existing worker mutation kernel, matching durable patches. Stale actor history must not commit writer metadata. The real-actor regression failed before the fix, then passed with the current-history control. Both creation and entry-patch suites passed (20 tests); final entry-patch proof passed 14 tests after the typed assertion correction. Production and state-test types and focused lint passed. Production incognito remains inactive and host-owned.
|
@clawsweeper re-review Fixed the CLI-history guard finding in 5c23a87 by forwarding the existing cliHistory guard into the shared worker mutation kernel. The real-actor stale-watermark regression failed before the fix, then passed with its current-watermark control. Both entry suites passed 20 tests; the final entry-patch fixture passed all 14 tests. Production/state-test types, lint, and fresh P2 autoreview are clean. Full details and timings are in the PR body. |
|
🦞👀 Re-review progress:
|
|
Final-head CI is blocked by the active GitHub Actions runner-assignment incident, not an observed source or test failure. Affected jobs on The final ClawSweeper review is complete with no remaining actionable findings, and local proof is recorded above. Native auto-merge remains armed for the exact reviewed head with CI enforced. Waiting for hosted-runner recovery before one bounded retry of the affected jobs; no code, timeout, runner capacity, or gate changes are being made for the outage. |
Move withIncognitoSessionRow unchanged into session-row-projection-read.ts, which already owns database-fact acquisition and is imported in production. Update its actor regression import and delete the test-only production file introduced by #165454. Preserve the existing inactive P7 marker; add no Knip configuration exceptions and change no runtime behavior. P7h2 reconciliation: #165628 also touches session-row-projection-incognito.ts. Apply any pending changes to session-row-projection-read.ts instead and keep the old module deleted. Proof: production Knip passes (69.44s; baseline failed on the sole unused file in 69.94s), actor row regression passes (35.62s), Madge reports zero cycles (38.67s), core typecheck passes (13.71s), touched-file typed lint passes (10.84s), and max-lines ratchet passes (11.12s). Codex P2 review is clean. The idle Incognito sibling Gateway regression passes on unmodified round-21 main a5a43a0 (79.96s). Its first candidate run stopped before Vitest because local artifact separation could not be verified; the baseline retry reused matching prepared artifacts with the guard unchanged.
|
The single failed-job retry recovered five of the six abandoned CI jobs. The GitHub Actions incident remains open. Further retries are on hold after the repeated infrastructure failure. The reviewed head remains |
|
Merged via squash auto-merge.
|
Move withIncognitoSessionRow unchanged into session-row-projection-read.ts, which already owns database-fact acquisition and is imported in production. Update its actor regression import and delete the test-only production file introduced by openclaw#165454. Preserve the existing inactive P7 marker; add no Knip configuration exceptions and change no runtime behavior. P7h2 reconciliation: openclaw#165628 also touches session-row-projection-incognito.ts. Apply any pending changes to session-row-projection-read.ts instead and keep the old module deleted. Proof: production Knip passes (69.44s; baseline failed on the sole unused file in 69.94s), actor row regression passes (35.62s), Madge reports zero cycles (38.67s), core typecheck passes (13.71s), touched-file typed lint passes (10.84s), and max-lines ratchet passes (11.12s). Codex P2 review is clean. The idle Incognito sibling Gateway regression passes on unmodified round-21 main 875af2b (79.96s). Its first candidate run stopped before Vitest because local artifact separation could not be verified; the baseline retry reused matching prepared artifacts with the guard unchanged.
…shared actor binding (P7h2, inactive) (openclaw#165628) * 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. * refactor(sessions): wire inactive incognito creation and entry patches Preserve captured actor and source authority through creation, entry patches, framed commit receipts, publication, and cleanup. Production remains host-owned pending atomic activation. * fix(sessions): type lifecycle removal selection by its input * style(sessions): distinguish source refusal from cancellation * fix(sessions): retain CLI history guards in actor patches Forward the prepared CLI admission and watermark to the existing worker mutation kernel, matching durable patches. Stale actor history must not commit writer metadata. The real-actor regression failed before the fix, then passed with the current-history control. Both creation and entry-patch suites passed (20 tests); final entry-patch proof passed 14 tests after the typed assertion correction. Production and state-test types and focused lint passed. Production incognito remains inactive and host-owned.
What Problem This Solves
The inactive incognito worker migration needs public session creation and generic entry patches to use the same captured actor as the other prepared session operations. Simple actor creation alone does not cover owner assignment, transcript initialization, and creation publication.
Integrated main
a33accd27f3d3331d0d42d8915038d3aa47b2421with a merge commit, preserving the landed #165525, #165548, and #165454 owners. The integrated candidate is5d0253429de39ad657e071f021cc71c40ab504bd. Production activation remains a separate lane.Why This Change Was Made
Route explicitly bound creation and entry patches through the existing actor and synchronous worker transaction. Preserve authoritative rereads, CAS and predicate ordering, transaction/commit grants, owner assignment, and retained preparation/cleanup. Framed transfers carry full results and session facts; the native COMMIT receipt certifies the exact completed transfer. Install acknowledged facts before callbacks and identity observers while retaining FIFO custody.
Preserve prepared source authority through settlement, including same-actor transaction predicates. Native-only and foreign-store source guards refuse explicitly pending their later actor composition. A regression demonstrated that the initial patch dropped source authority and wrongly committed after revocation; it now rejects without writing. Physical-source capture and lifecycle-entry selection are extracted into their existing responsibilities to satisfy line caps.
User Impact
Inactive: production incognito remains host-owned. No activation flag, native fallback after actor failure, schema, durability, retention, expiry, permission, public configuration, or update change. Accepted work settles independently of scheduler cancellation; unknown outcomes never authorize replay.
The final delta is 22 files against the integrated main baseline. It adds no environment names and changes no stored schema or data format. Update and downgrade behavior is unchanged.
Overlaps: the merged prerequisite and adjacent history/Memory/lifetime lanes above, plus umbrella #162433. The integration keeps main's extracted authority and lifecycle owners and pending-history settlement helper. It removes the competing lifecycle extraction from this lane.
The previously recorded personal-account SQL debt was removed on main by #165547: creation now retains prepared account authority through
prepareUserModelAccountAuthority(src/gateway/session-create-model-selection.ts:197) and checks its published authority at commit. This lane adds no host SQL to worker grants. Full actor-bound Gateway acquisition and private-read composition remain part of atomic activation.Evidence
Final repair head:
5c23a8739d125d96069143f182e5976a0b3bba97. Fresh P2 autoreview of the follow-up is clean; focused lint andgit diff --checkpass.ClawSweeper follow-up: its integrated-head review found that the actor patch worker dropped
cliHistorywhen rebuilding mutation options. The worker now forwards that complete guard to the existing transaction-local mutation kernel, matching the durable worker. A real-actor regression captures a native watermark, advances the transcript, and confirms stale writer adoption is rejected without publication or persisted writer metadata; the current-watermark case succeeds. This is a guard-forwarding fix, with no new owner, SQL on the host, signature, import edge, or stored-data change.The stale-history case failed before the fix because the patch resolved and committed
activeWriterRunId(79.51s command wall). After the one-line fix, all 20 creation/entry-patch tests passed (190.73s). Final entry-patch fixture validation: 14 tests passed (67.69s command wall; 30.19s Vitest wall, about 7.8s test execution). Production types and the state-test graph pass. The fixture initially accessed an internal writer field through the public actor read type; the final assertion checks the returned object's metadata without a cast. The final follow-up changes no emitted API signature, so the released SDK report below remains applicable to the integration.Integrated-candidate proof on
5d0253429de39ad657e071f021cc71c40ab504bd:pnpm test <selected files> --maxWorkers=1; 1,424.51s command wall time. Covers real Gateway close, incognito creation/patch/lifecycle/history/Memory/compute, SessionManager, SDK context, durable creation, shared-import closure, runtime build graph, and extracted PR wrapper execution. The 6 new creation and 12 entry-patch tests all pass.pnpm changed:lanes --jsonselected core and core-test lanes; no extension type lane was selected.git diff --check: passed. Fresh isolated P2 autoreview of the complete integrated delta: clean.v2026.9.8: existing public creation/patch signatures, synchronous timing, and callback/options shapes are unchanged. Added actor and publication helpers remain internal; no released compatibility record is needed. The generated released SDK comparison passed, including isolated revision cleanup, in 1,397.95s (digest2402b9d8): the cumulative release-to-main report includes 1 added/8 removed entrypoints and 2,371 changed exports from already-landed main work. This PR changes no SDK facade or entrypoint manifest; its public creation/patch signatures are unchanged. Focused type-aware core lint passed. The initial lint invocation incorrectly selected the production tsconfig, unnecessarily triggered plugin declaration generation, and timed out before linting; the correct source-backed lint config completed without a source change or timeout increase.check-additional-boundarieswas retried; it passed in 206s, and the dependent gate passed. Armed native auto-merge completed as6f227907bf7aa9457c26ff431a9327aebdd5359e, verified onorigin/main. Final trusted ClawSweeper review has no actionable findings.Original candidate validation and infrastructure history
Runtime and SDK proof is pinned to
985ba600de7d; the final follow-up only renames a callback-local variable forno-shadow, with no behavioral or emitted-declaration change. Focused type-aware lint and a fresh P2 review cover that correction.All tests used
pnpm test <selected files> --maxWorkers=1. 186 tests passed across 21 files:Final actor, durable creation/patch, SessionManager, and worker/history import suites: 147 tests / 14 files, 1,287.93s command wall time.
Completed Gateway creation/close, lifecycle-source authority, shared-registry imports, runtime build graph, and wrapper suites: 39 tests / 7 files, 1,123.19s combined Vitest shard time. The containing command was intentionally interrupted after these completed shards to repair the extracted helper's TypeScript signature; it was not treated as an all-green command. Remaining suites were rerun above.
New creation suite: 6 tests, 7.748s Vitest file time; new entry-patch suite: 12 tests, 6.001s. Both assert zero caller-thread SQL for the moved operations. These use the real retained actor/worker transaction, framed transport, and close boundary; mocks would not prove those contracts.
Source-authority regression failed before the fix (154.35s command wall) because revoked authority incorrectly committed, then passed after preserving its source guard.
Gateway build: 1,034.22s, after recovering an initial build-stamp rejection caused by editing during preparation. This build precedes the mechanical lifecycle-helper typing correction; current worker compilation and core type checks cover that correction.
Madge: 0 cycles, 232.36s. Worker ratchet: passed; T1 883 → 883. The indirect importer audit found existing fork/host-owner routing sufficient; the two new actor suites are explicitly routed in the same change. The compiled-wrapper inventory and extracted-wrapper execution tests passed without inventory additions.
Fresh isolated Codex autoreview through P2: clean, 360.90s for the final pass. No accepted/actionable findings remain.
SDK API comparison completed successfully in 2,417.51s (including isolated revision installation/rendering and cleanup): 0 added/removed entrypoints, 0 direct export changes, 129 reachable-closure changes (digest
ab352451). The underlying changes add internal incognito entry operations, framed publication, and source/lifecycle helper declarations; existing public method signatures and synchronous timing remain intact. The actor/binding types are absent from the releasedv2026.9.8SDK surfaces checked. No SDK surface budget was raised.Full
node scripts/check-changed.mjs --base bd77e156ebc17f89a19889ce773e836dfbd0fc1con Hetzner passed, exit 0, 2,591s (43m11s), with no skipped gates. The receiver verified headad6ad1b22d1fba5eb8b3456153bcf857fd887caa, tree7da34fdbad10fafe1cc99ed67f3d6b4d5c5d1380, and the pinned base before execution. Production types, all 27 test type graphs, dead-export scans, core/script lint, and the remaining guards passed. Core lint reported 11 existing file-length warnings on untouched files and zero errors; script lint had zero warnings/errors.Infrastructure qualification: the native Crabbox SSH/runner wrapper reported outer exit 1 after the check printed its explicit exit-0 result. Saved evidence contains no additional source, check, or policy failure explaining that discrepancy; the wrapper itself is not claimed green. The command was not replayed. The wrapper exited, its source capsule was removed, and the Hetzner lease was confirmed released.
Earlier recovery: local
check-changedreached core lint and hit its existing 900s timeout. Testbox stayed queued without a runner and was stopped. The initial AWS manifest sync reached its transfer deadline before executing the gate; that lease was released. A fresh origin-seeded AWS attempt then hit the provider vCPU quota without allocating an instance. The supported Hetzner fallback completed the check above. No cost cap or check timeout was raised.