Repository navigation
refactor(sessions): compose incognito domain entry points and message-tool outcomes (P7l, inactive) - #165895
Conversation
Capture actor bindings through domain, Board, pending-input, ACP and lifecycle entry points. Reuse the durable message-tool outcome transaction on the incognito actor and preserve accepted settlement and private result disclosure fences. Production acquisition remains host-owned until atomic P7 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. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 6, 2026, 3:01 AM ET / 07:01 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR carries captured Incognito worker bindings through session operations, retains them during asynchronous cleanup and outbox delivery, and adds worker-backed message-tool outcome recording. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this remains useful, distinct prerequisite work, with no actionable introduced defect found. The previous data-model compatibility warning is cleared by the inspected diff; activation remains separately scoped. Priority: P2 Review scores
Verification
How this fits togetherIncognito sessions keep private session state in a process-lifetime database. Session, Gateway, and plugin entry points send operations to its worker owner, which checks authority and publishes committed results. flowchart TD
A[Session and Gateway requests] --> B[Capture private session binding]
B --> C{Binding available}
C -->|Yes| D[Existing Incognito worker]
C -->|No| E[Existing storage route]
D --> F[Check authority and generation]
F --> G[Commit and publish results]
E --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +549, Tests +606, Docs +26. Total +1181 across 51 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep this composition inactive until the planned atomic cutover installs acquisition authority and retires the documented native routes together. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an inactive internal refactor, and no concrete introduced failure was established during read-only inspection. Is this the best way to solve the issue? Yes: composing the existing actor and domain owners preserves one storage responsibility, while the documented atomic activation owns the eventual routing cutover. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0c6af8bb3e8c. 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 |
Integrate the production dependency audit repair and session authority/creation owners while preserving inactive, host-owned incognito acquisition. P2 autoreview of the integrated delta is clean; post-integration checks are running before publication.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…-tool outcomes (P7l, inactive) (openclaw#165895) * refactor(sessions): compose inactive incognito domain entry points Capture actor bindings through domain, Board, pending-input, ACP and lifecycle entry points. Reuse the durable message-tool outcome transaction on the incognito actor and preserve accepted settlement and private result disclosure fences. Production acquisition remains host-owned until atomic P7 activation. * style(sessions): keep captured bindings in local constants
What Problem This Solves
The inactive incognito actor adapters still require per-call bindings at domain entry points, and message-tool run outcomes have no actor operation. This is the P7l composition prerequisite for the single atomic incognito worker cutover.
User Impact
No production routing change: ordinary incognito acquisition remains host-owned. This PR does not activate the worker owner, delete native routes, change schemas or retention, add configuration/environment names, or change shared ACP persistence.
Why This Change Was Made
Domain entry points capture the existing shared actor binding before yielding and reuse the existing adapters. This covers collaboration, categories, suggestions, reactions, heartbeat outcomes, progress cards, reports/outbox, Board, pending input, ACP reads/writes/startup preparation, and deletion/reset/fork composition. Deferred outbox delivery retains the actor across the engine callback and acknowledgment without holding its writer FIFO. Gateway deletion refreshes full entries after cleanup; locked plugin-owned deletion uses the existing authoritative owner validation.
Message-tool outcomes now have a bounded actor command using the durable backend's recording transaction. Canonical actor admission supplies the schema. Transaction/commit grants check the captured generation, and the existing actor receipt publishes committed facts; a lost reply never authorizes replay.
The remaining acquisition/authority work belongs to P7k, and history/private-display work to P7m. ACP control retains its shared mutation-facts owner and requires P7k's actor facts/grant integration. The full reset service's pre-helper native acquisition/guards remain part of atomic activation. No end-to-end activation proof is claimed here.
Related: #162433 (standing incidental overlap), #165185 (reset cleanup), #165819 (entry/lifecycle owner). Sibling lanes:
dbasync/incogp7k,dbasync/incogp7m; shared binding validation uses the same physical-root correction as P7k. The second landing must reconcile overlapping hunks.Evidence
Pinned comparison base:
ab2e92694e635beb25ebc9808756728897d11356. Original source head:8ff82b7f86195d7a1c7b25a6a4eb9cd36975b41d. Production +699 / −150 / net +549 (849 changed lines) across 40 production files, plus nine test files and two docs. Inventory: T1 846 → 846, 629 files / 2,543 counted calls; 0 newOPENCLAW_*names.All focused commands used
pnpm test … --maxWorkers=1. Measured local wall times include cold imports and compiled-worker preparation on the loaded host.pnpm buildThe shared-registry gate includes
test/scripts/runtime-process-build-graph.test.ts, reply/history/reconcile import closures, shared-state worker imports, and worker admission imports. Importer routing was audited: changed actor suites already use the host-owned core project, while durable config/Gateway/plugin callers use existing fork projects. No routing changes or worker pins were added.The real server-close regression proves accepted staging, release and interruption settle after scheduler abort before actor transport teardown. Actor-bound tests prove zero caller SQL for moved operations, exact generation rejection, committed publication after lost replies, and no replay. The new outcome operation uses the same backend whose durable row contents and 10,000-row bound are tested in the caller group.
Validation caught and fixed a progress-card inference cycle, a native cleanup-generation read, missing captured lifecycle revisions, and private ACP result disclosure after borrower release. Four ACP release cases demonstrably failed before the fence repair (
disclosed=truedespite the retained parent's later rejection); all pass afterward. Fixture ordering/canonical-entry mistakes were also corrected. The original Gateway file run passed its 17 existing cases (556.95 s including the initial actor-case failure); the two actor deletion/reset cases pass after repair. An early test preparation was rejected because it overlapped package output generation; subsequent build/test work was serialized. The first changed-file pass also found a missing QA Lab → Crabbox workspace link from the filtered Gateway setup. Installing its already-declared dependency set fixed both extension typechecks without source or lockfile changes. The next changed-file pass reached lint after all typechecks/dead-export scans passed and found parameter-reassignment/shadowing violations; the mechanical cleanup preserves every public parameter name and was independently reviewed. No failure was hidden by weaker guards or retries.SDK digest
32f31d6awas inspected: the closure deltas reflect the new inactive outcome command, optional lifecycle owner/outbox custody/parent-key fields, narrower internal actor requirements, and the prepared ACP reader. Existing public entry-point declarations are unchanged; the additive preparer is on the existing JS-local ACP facade. The v2026.9.8 Gateway runtime and shared request-context types were inspected; no synchronous context service method was replaced. Build, functional suites, Knip, cycle, and exact-tree SDK evidence cover implementation commitde68fd50ab6bb142c4771a406b43c823772a4603; the later reviewed cleanup only replaces reassigned parameters with local constants and removes variable shadowing, preserving signatures and behavior. The full changed-file gate passed on the final source tree; runtime import-cycle validation also reported zero cycles. Original CI timing was unavailable at publication; current landing proof is recorded below.These are real worker/Gateway boundary suites, so existing process startup and storage-owner fixtures exceed the five-second test target. The added cases reuse suite owners; no new per-case Gateway boot, real sleep, serial configuration, or test-only production module was added.
Native routes the atomic activation must retire
Line references are to this candidate; counts estimate deleted production lines, not whole files. Retain worker kernels and named durable SDK/maintenance contracts.
src/config/sessions/session-sharing-store.async.ts:188;src/config/sessions/session-metadata-write.async.ts:29src/config/sessions/session-group-categories.ts:81src/config/sessions/session-sharing-store.ts:60;src/config/sessions/session-suggestion-store.read.ts:39src/config/sessions/session-reaction-store.ts:110src/infra/heartbeat-outcome-store.ts:222src/gateway/progress-card-store.ts:136,189src/config/sessions/session-accessor.sqlite-transcript-reports.ts:248,530,581,645src/agents/harness/context-engine-turn-outbox-store.ts:46src/boards/sqlite-board-store.ts:137,247,492src/config/sessions/session-pending-input-source.ts:70src/config/sessions/session-pending-input-store.ts:230,284src/config/sessions/session-pending-input-history.ts:159,211src/config/sessions/session-pending-input-receipts.ts:51src/acp/runtime/session-meta-read.ts:139;src/acp/runtime/session-meta-write.ts:121src/config/sessions/session-parent-fork.ts:62;src/config/sessions/session-accessor.sqlite-parent-session.ts:181;src/config/sessions/session-accessor.sqlite-lifecycle.ts:125,552;src/acp/runtime/session-meta.ts:137src/infra/message-tool-run-outcome-store.ts:97Estimated total: 421–437 lines, plus newly unused imports. Gateway deletion's durable alternative calls stay; their transitive incognito host-selection arms belong to P7k. The full reset service still has pre-helper native selection/guards at
src/gateway/session-reset-service.ts:569,697,777,1049that must be switched during atomic integration, not deleted wholesale. Startup reconciliation's native reads remain for durable contracts. Shared ACP live metadata checks insrc/acp/runtime/session-meta-control.ts:227–252are retained other-owner authority debt, not incognito DB routes. Preserve withdrawal's unsupported-incognito refusal, offline lifecycle/fork kernels, the released opaque Board write contract, and durable synchronous pending completion.Landing validation
Integrated main
98262d8b5fdaf4b1be499fc10c7426a0f2be5b6ethrough merge commit924a698c542a724b73e9a995184a3e9e3497d974, with no conflicts or production activation. The only overlap was the worker-access documentation. Session-authority B1 and native creation writes preserve host-owned incognito acquisition. P7k remains an independent pending prerequisite; the second landing must still integrate it.The original
security-fastfailure was the independently reproducedsource-map-jsadvisory GHSA-68fv-2mgg-jv7q. Main fixed it in9c66e8f40532; that fix is included, and the production dependency audit now passes. No dependency fix was authored in this PR. The old run's fail-fast cancellations remain unrun historical coverage, not passing results.Post-integration proof on
924a698c542a724b73e9a995184a3e9e3497d974:pnpm test <25 explicit files> --maxWorkers=1pnpm tsgo:corepnpm tsgo:core:testpnpm tsgo:extensionspnpm tsgo:extensions:testpnpm check:madge-import-cyclespnpm deadcode:knip36ef17b6Focused coverage includes the nine modified suites, the real Gateway deletion/reset flow, B1 prepared/reply authority, entry patch/publication owners, ACP storage/control readers and writers, durable message-tool outcomes/outbox, Discord and Telegram startup reconciliation, runtime-process build graph, and reply/history/reconcile/shared-state import closures. No source repair was needed after integration. Released ACP signature checks against
v2026.10.1-beta.1andv2026.9.8remain valid: the public reader keeps its one-argument Promise contract.A host restart interrupted the first validation attempt and wiped its temporary logs. The completed P2 review and core production typecheck were observed before interruption; unfinished checks were rerun with durable logs. The interrupted core-test owner retained a checkout-local build lock; its exact owner and descendants were verified absent before documented recovery. No other process or lock was terminated or recovered.
ClawSweeper's original exact-head review found no actionable code defect. Its automated Board data-model warning was inapplicable: that file's complete PR diff changes imports and type annotations, not SQL, tables, serialization, or runtime expressions. The new outcome command reuses the existing admitted table and recording transaction. Fresh review and CI must bind the published integration head.