Skip to content

refactor(sessions): compose incognito actor acquisition and authority (P7k, inactive) - #165885

Merged
steipete merged 8 commits into
mainfrom
dbasync/incogp7k
Oct 6, 2026
Merged

steipete merged 8 commits into
mainfrom
dbasync/incogp7k

Conversation

@steipete

@steipete steipete commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The incognito actor needs a complete acquisition, discovery, and authority composition before one atomic runtime cutover can retire native host ownership. This is P7k's inactive prerequisite.

User Impact

No runtime activation or user-visible routing change. Production acquisition stays host-owned; native routes remain until the coordinated activation. No schema, stored-byte, retention, durability, permission, configuration, dependency, or update changes. No new environment-variable names. Released synchronous SDK contracts remain unchanged; the v2026.9.8 Gateway context type reachability was checked. T1 delta: 0 for this inactive prerequisite. Retained context readers reject further message disclosure immediately when their owner closes.

Why This Change Was Made

Existing-only and explicit-create acquisition share the existing binding and canonical execution owner. Physical identity is captured before yielding, nested scopes retain enclosing authority, and accepted work is joined before release. Entry/current/claim reads, logical candidates, combined discovery, and placement evidence retain their actor and FIFO snapshot through consumption. Mixed discovery, placement, and durable completion lineage stay in one captured state root.

Sharing, delivery, presence, and completion lineage consume the actor owner's published facts. A pending creation exposes only its exact live operation's transaction preimage; accepted persistence survives scheduler admission cancellation while new reads refuse it. SessionManager/Codex iterators revalidate on disclosure and close with their consumer. Target-based synchronous SDK refusal is prepared but remains inactive for unbound callers.

Small coherent extractions keep existing owner files under their growth caps. There is no second owner, synchronous bridge, persistent cache, or new worker service. Inactive helpers live in production-imported modules with the P7 internal Knip notes.

Overlap: parallel P7l/P7m work, #165819, and the standing #162433 umbrella. Hunks stay within acquisition/authority; the later lander must adapt overlapping hunks. The final activation must also coordinate the remaining native-classifier callers in entry status/freshness, trajectory writing, and follow-up turns.

Evidence

The following evidence describes the original implementation at 4863c5b66d793; current landing verification follows below.

  • Final focused replay: 116 tests / 9 files passed, pnpm test <files below> --maxWorkers=1, 552.17s wall. Per-project runner durations: completion lineage 76.72s; real Gateway close manager/compute 102.95s; actor sessions 35.48s; combined-store worker 26.67s; status tool + real-storage status 34.73s; full-context snapshots 97.98s; Codex history adapter 119.34s.
  • Earlier broader sweep: 308 passed, with 11 status-fixture failures subsequently repaired and covered by the final 38-test status replay (841.97s wall). This sweep passed acquisition/SDK actor tests, entry/current/admission/placement siblings, sharing/presence/completion, runtime-process build graph, and all three selected import-closure suites (get-reply, history-read, transcript-reconcile).
  • Zero caller-thread SQL boundary assertions pass for the moved actor paths. The real Gateway shutdown tests prove accepted manager/compute work settles before actor transport retirement while new work refuses.
  • Red/green regressions: mixed placement returned a false absence before repair (151.64s red); durable context disclosed one message after close (145.42s red); mixed completion selected the foreign root (91.49s red). Accepted creation after scheduler cancellation was 53.15s red → 145.66s green. The final full-suite replay includes all fixes.
  • node scripts/check-changed.mjs --base ab2e92694e635beb25ebc9808756728897d11356: ran for 1,227.35s and stopped at core lint. All earlier guards and core/test type graphs passed. Branch-local lint findings were repaired at their owners, then all changed core files passed type-aware lint (69.09s), core typechecking passed again (11.69s), script lint passed (56.21s), and every later planned architecture/auth guard completed separately (162.16s). The inherited no-shadow error at src/infra/heartbeat-runner.scheduler.test.ts:436 is outside this diff: its blob is identical to the pinned base (33685b11891470a859e8687746eca3a865fe36b5) and current main already fixes it in ac3830b776a3d (perf(worktrees): avoid warm checkout admission spawns #165750). This is not a claim that the full pinned-base command passed.
  • pnpm deadcode:knip: passed, 221.72s. Madge: 0 cycles, 157.77s. Subsequent repairs changed no production import edges or exported-helper reachability.
  • Worker ratchet against the pinned merge base: passed, 11.84s standalone; T1 846 → 846. Existing environment-name guard 464/464, zero added names.
  • Gateway qaRuntime build: passed, 219.59s, including CLI bootstrap import guard. A broader pnpm build was stopped in package declaration generation after 689.64s; it is not claimed as passing.
  • Fresh independent Codex P2 review: scoped-clean, no accepted/actionable findings, 166.97s. SDK API comparison: completed against committed head 4863c5b66d793, 378.03s; 0 entrypoints added/removed, 0 direct export declaration changes, 129 reachable declaration-closure changes across 23 entrypoints, acknowledgement digest 709ebe1c. The closure delta consists of internal actor/type additions, private helper/type moves, and the optional incognito merger reader; no Gateway-context service method was changed from synchronous to asynchronous. This is not an empty SDK diff.
  • Worker-cutover routing audit: actor/worker suites already use their host-owned projects; the SessionManager incognito suite is added to vitest.database-worker-core-paths.mjs. Ordinary status/offline paths retain their existing local route.

Focused replay files: src/gateway/mcp-http.completion-lineage.test.ts, src/gateway/server-close.incognito-manager.test.ts, src/gateway/server-close.incognito-compute.test.ts, src/state/openclaw-agent-execution-incognito.sessions.test.ts, src/config/sessions/combined-store-gateway.worker.test.ts, src/agents/openclaw-tools.session-status.test.ts, src/agents/openclaw-tools.session-status.gateway-model.test.ts, src/agents/sessions/session-manager-model-context-snapshot.test.ts, and extensions/codex/session-history-worker-runtime.test.ts.

The longer suites exercise real worker FIFO, retained storage owners, and actual Gateway close order; a pure mock would bypass those contracts. Most wall time is import/compiled-worker preparation on the loaded host. These timings describe the original publication candidate; landing verification follows below.

Failures were investigated rather than hidden: auxiliary test actors were closed per test to fix worker-capacity exhaustion in the original suite order; the status mock now covers the direct leaf selector; a malformed expected-path argument in the new completion test was corrected after the production fix passed its authority assertion. Callback contracts now explicitly declare this: void; a shadowed local and an obsolete max-lines suppression were corrected. Those final lint repairs preserve the tested runtime behavior. No limits, timeouts, assertions, or baselines were weakened.

The proof uses injected actors and isolated state. It establishes inactive composition, not the final atomic activation. Native host routes and the separate private-display consumers remain explicit activation work. No new SQL was found in this lane's actor-side grant checks: shared-state and agent admission consume in-memory generation/refusal facts; completion file-source checks use filesystem identity. Caller-supplied authority callbacks retain their existing contracts.

Landing verification

Main was merged without conflicts in 85bb55cb3818d, including the heartbeat lint repair. bbfbabd31fa04 fixes two PR-caused failures from CI run 37394813906: related actor acquisition now retains fixed root authority instead of recursively including itself in mutable presentation checks; the complete set of live sources still guards synchronous consumption. The direct completion-root regression now has a dedicated host-owned actor fixture at the broker's two-worker floor, avoiding an extra ephemeral actor after the MCP suite fills the budget. The canonical ratchet also pruned exactly the retired status-tool max-lines entry. No assertions, capacity limits, timeouts, or production routing were weakened or activated.

The row failure reproduced 5/5 on the integrated PR and passed 5/5 on the merge base; it also passed in inspected scheduled-main jobs 112009431938 and 112028952064. The capacity failure reproduced 5/5 with an eight-CPU fixture. The repaired row and relocated fixture each passed 5/5 replays. Native-wrapper wall totals were 500.57s for the five row runs and 332.14s for the five lineage runs; cold worker compilation accounts for most of the slow first runs. The original MCP suite passes all 14 tests under the same constraint, and its baseline passed 5/5 full-file replays. These commands used node scripts/run-vitest.mjs <file> --maxWorkers=1, the underlying pnpm test runner. A separate Slack announcement-settlement timeout from the original CI run remains under isolated baseline/PR investigation; it is not being labeled inherited or flaky without evidence.

Fresh independent Codex P2 review of the complete repaired candidate is scoped-clean, including the complete row-reader source. Post-integration runtime build-graph, PR wrapper inventory, and get-reply, history-read, and transcript-reconcile import-closure tests passed. Knip passed, and Madge reported 0 cycles; the later repair adds no production import edges or module exports. node scripts/check-changed.mjs --base 2f1e555cc58fa passed on the repaired tree, including all selected production/test typechecks, lint, ratchets, export scans, and guards. It reports one existing max-lines warning in the unchanged server-close.agent-databases.test.ts. The final-head SDK report (bbfbabd31fa04) has 0 added/removed entrypoints, 0 direct export changes, and 129 reachable declaration changes across 23 entrypoints (digest 3b4046bd).

Released-contract inspection covered v2026.9.8 and v2026.10.1-beta.1, including Gateway context reachability, SDK subpaths, and runtime session methods. The asynchronous status selector and moved scope helpers are internal; released synchronous selectors remain unchanged. The released context-reader callback and Promise signature are unchanged, so no compatibility adapter or deprecation record is required.

ClawSweeper's fresh review of bbfbabd31fa04 completed at 2026-10-06 01:24 UTC with no actionable code findings. Its data-model checklist was reviewed against source: session-accessor.entry.ts adds an internal binding-aware selector while preserving the synchronous resolver; session-status-session-resolve.ts projects existing entries for display. Neither changes persisted fields, stored bytes, schema, migrations, durability, retention, or update behavior. This is an inactive composition with no stored-data migration to exercise. Its fresh review explicitly confirms that the previous migration-proof concern does not apply; the automated checklist still repeats that heuristic. The row-reader repair also overlaps the in-flight P7m work; its hunks preserve the current owner's behavior and remain scoped to this integration failure.

Integration at 5aa0ba39cbe5d

Merged main 98262d8b5fdaf without rebasing or textual conflicts. This includes the landed source-map-js repair (9c66e8f40532), session-authority B1 (#165370), native creation writes (#165819), and lifecycle-lock cancellation repair (#165898). No dependency change was authored in this PR. Two new internal callers on main still imported the moved scope classifiers from the runtime module; the post-integration typecheck identified them, and their imports now use the canonical request owner. Both sides' behavior is preserved and production acquisition remains host-owned/inactive.

Fresh whole-candidate Codex P2 review is scoped-clean. Post-integration production and core test typechecking, Knip, and Madge (zero cycles) passed. The completed focused replay covers 185 tests / 22 files, including actor acquisition and lineage, actual Gateway shutdown, combined storage, status, context snapshots, SDK/Codex history, sandbox status, tool authority, wrapper inventory, build graph, and import closures. The resumed 19-file portion completed in 2084.65s; the earlier 3-file portion passed before the coordinator restart. Final-head SDK comparison passed with 0 added/removed entrypoints, 0 direct export changes, and 131 reachable declaration changes across 24 entrypoints (digest 759b9911dd90cc451fd05fdc6c60c2f285cb9a2552c63f505a360aa49355be6d). ClawSweeper completed on this exact head at 2026-10-06 06:28 UTC, with no actionable code findings; its technical assessment explicitly says the prior migration-proof concern does not apply.

Current-head CI 37423200298 passed its security, production/test type, lint, and other executed checks except checks-node-changed-4 and the downstream aggregate. The remaining failure is the Slack announcement-settlement case in test/e2e/qa-lab/runtime/channel-progress-presentation.e2e.test.ts: the second task remains pending after model completion. The CI checkout was merge 1acf2f6484e5491193d3102e5e00b8d4d61f6a70, with main parent 20306571364c5b8df244fba15e88727b2b7c7a0e. Attribution is still under investigation with unchanged full-file main/candidate replays and CI-equivalent two-CPU affinity. Passing higher-capacity replays are not being treated as a fix or proof of inheritance.

Prior candidate (1b969e54984c1)

Merged P7l from main ca43d19197888 in 560f85d2f727b, preserving both binding helpers and both inactive documentation sections. Then merged main 253b51435c85 in 1b969e54984c1, including the observer persistence fix from #165680. Background observer persistence now leaves the publishing turn's async admission context; the new owner regression proves that persistence queues after the publisher and joins disposal. The trajectory writer preserves both the extracted reader classifier and main's internal worker-backed Runtime admission. Production incognito remains inactive and host-owned. The new acquisition and synchronous-refusal entry points still have no production callers.

The final independent Codex P2 review is scoped-clean. An earlier pass found a real summary-read cancellation gap: the consumer could receive rows after admission ended, before the outer promise rejected. The retained snapshot authority now checks that signal before consumption. A regression using the real actor/worker failed on the old guard at the disclosure assertion and passes with the fix. It lives in the existing actor-binding suite, preserving the line-cap budget without removing coverage or adding a fixture module.

Post-integration proof passed: 82 tests / 10 files covering the observer authority fix, trajectory writes, actual Gateway shutdown, incognito session composition, runtime build graph, and import closures. The cancellation repair additionally passed the complete 16-test actor-binding suite (30.81s Vitest duration), then the final receiver-bound regression passed alone (11.80s Vitest; 76.51s native wrapper). Production and all core test typecheck shards passed on the final tree. Full core/script lint and the remaining architecture/authorization guards passed; the two changed guard/test files passed targeted type-aware lint again. Madge reports 0 cycles, Knip passed, and the line-cap ratchet passed. No production import edge or released signature changed in the cancellation repair.

The full check-changed invocation at the P7l integration remains failed, solely at an inherited dead-export scan: OUTBOUND_GREETING_FALLBACK_MS in extensions/voice-call/src/webhook/realtime-call-session-control.ts. Scheduled main job 112162743824 fails on that same export. Its blob is identical on the tested main baseline, main 253b51435c85, and this candidate (a0501c5ae0d7e9f35c60dcf899072e7ebd9b7266), and this PR does not touch the file. Every later planned check was run separately and passed; this is not a claim that the complete command passed.

The earlier Slack settlement timeout did not reproduce in five full-file runs on main 20306571 or in a paired full-file replay of that main and exact failed CI merge 1acf2f64: each paired run passed 16/16 tests under two-CPU affinity. The Slack case took 81.446s on main and 83.382s on the candidate. The VM had 16 GB rather than CI's 8 GB, so this does not prove a fix or inherited failure. The candidate then integrated the newly landed observer ownership repair. No unchanged CI rerun was requested.

Final-head CI 37441307139 tested merge 4a36af0e93f51296b849b4868d2655c80d3a634d, with ordered parents main 7f483b7a23a9 and this head 1b969e54984c1. The complete Slack presentation file passed 16/16 in job 112196049852, 414.97s on 2 CPUs / 8 GB; the previously failing case passed in 89.847s. This supplies the required final-head flow proof. The redundant queued Testbox was stopped before it executed any product command. The earlier timeout remains nonreproduced; a passing replay is not being presented as proof of its cause.

The only failed CI roots are production types and core test type stripe 1, plus their downstream aggregate. Both report the same TS18004 at src/cli/gateway-cli/run-loop-shutdown-completion.test-support.ts:54: gatewayLog has no value in scope. Main's #166012 (607d5ee583c00) removed that parameter binding while retaining the shorthand argument. The fixture has identical blob 563bb2cc97b9b8ae8e17462b832154f4eb55c29e in the CI main parent, tested merge, main 9ad97b209d6e, and the subsequently captured main f997ec3775567. This PR does not change it. Independent execution of both the production tsgo project and the exact core-test-config-cli graph on main 9ad97b209d6e reproduces that diagnostic. All other selected CI jobs passed; zero jobs were cancelled. This inherited-failure qualification was prepared, but no merge request was submitted. Main subsequently fixed this error in 7b9405e22d7b0; the current candidate integrates that fix instead of using the exception.

ClawSweeper completed its review of this exact head at 2026-10-06 09:19 UTC, with no actionable code findings and sufficient real-worker proof. Its technical review again confirms that no stored-data contract changed and that the migration-proof concern does not apply. The final-head SDK comparison completed locally: 0 entrypoints added/removed, 0 direct export changes, 131 reachable declaration changes across 24 entrypoints. Acknowledgement digest: 83468345 (full digest 8346834571de5f46768c7c42654c14faa182b2138feee38ef3c220927175077f). This is not an empty SDK diff; the released synchronous methods and callback contracts remain intact.

Prior integration (77a3c37e0c01e)

Merged current main 67ec6071cb6fe without rebasing or textual conflicts, including the gatewayLog fixture repair 7b9405e22d7b0. A fresh independent Codex P2 review of the integrated candidate is scoped-clean. Read-only integration audit confirms production remains inactive and host-owned: acquisition/refusal helpers have no new production callers, native incognito exclusion remains, and the summary cancellation guard is preserved.

The concurrent-creation entry admission/read changes from main preserve the explicit actor branches. Main's transcript SDK updates and their compatibility record/type test are unchanged from main; the released synchronous callback remains available. No dependency changes were authored here. Post-integration focused suites passed 138 tests / 9 files (summed Vitest project durations 928.91s, excluding shared preparation). Production and every selected core test typecheck shard passed. Knip passed and Madge reported 0 cycles. The final SDK report completed locally with 0 entrypoints added/removed, 0 direct declaration changes, 131 reachable exports across 24 entrypoints; digest dff4275e2bfdbf6850c17957cbce1119c3ec6affbe8f5c998664e3167067592f. Independent declaration comparison confirms the same 12 unique internal deltas and no new released-contract obligation. Remaining lint/architecture checks and CI failure classification are still in progress.

Current landing candidate (752ebb4c4314f)

Merged main e62b6f87bfcba, including P7m (#165890), without rebase or textual conflicts. The shared actor/binding integration retains both P7k acquisition/cancellation guards and P7m history/compute callbacks. Production acquisition stays inactive and host-owned. The integrated tree includes the voice-call unused-export repair. No dependency change was authored in this PR. Later overlap with #166085 removes descriptive comments only; its relevant delta was inspected and leaves executable statements, signatures, and admission behavior unchanged.

Fresh independent Codex P2 review is scoped-clean. The combined focused replay passed 127 tests / 9 files, using node scripts/run-vitest.mjs <files> --maxWorkers=1, in 985.73s including shared worker preparation and cleanup. It covers acquisition, session composition, history, Memory, compute, actual Gateway close, runtime build graph, and import closure. Madge passed with 0 cycles, and pnpm deadcode:knip passed. All selected production and core test typecheck lanes passed after this integration.

The final SDK comparison completed locally for this exact head against e62b6f87bfcba: 0 entrypoints added/removed, 0 direct declaration changes, 131 reachable exports across 24 entrypoints. Acknowledgement digest: f7fed0cf (full f7fed0cf9ab6e94cb5d4174390b1d1e806067fe52d3b10728868a05fd98a5f46). Independent comparison confirms that P7m's optional compute callback and history binding are identical on both sides; the released synchronous contracts remain intact, with no new compatibility obligation.

The full check-changed command passed its preceding guards and types, then stopped at the untouched src/agents/model-catalog.runtime.ts re-export of loadManifestModelCatalog. Main removed it in ece9d9cbce947 (#166077). The PR's file is identical to its base, and an explicit prospective-merge check against main 78e8de276bd2 retains the main repair exactly (blob 48bb8e2a2c2790e1643e5ca81133f6bb026dbf2d). No passing full-command result is claimed. All ten remaining planned lint, schema, architecture, and authorization checks passed separately.

Current-head CI 37454999910, attempt 1, tested merge fcfa2dbdf6fd2df5e6818b59b95f8dc0cbbf46c6 with ordered parents main b2fab204731e and this head. Its tree was independently reconstructed. The complete 123-job inventory has exactly two failed Node jobs and their downstream gate, with zero cancelled CI jobs; all other selected families passed.

WebChat startup recovery fails in sendQueuedTurn:323 with agent.wait, CLIENT_TIMEOUT, and a 30000ms deadline. Scheduled main job 112226285417 at dea0ebb68779c has that exact failure. Twenty relevant test, request, admission, and client inputs are byte-identical across the CI baseline, tested merge, failing main, and captured main 78e8de276bd2.

RPC restart ownership has the same pre-close 120s test timeout and 180s cleanup timeout independently observed in main job 112226285349. This run additionally enters a closing-resource retry loop, logs 977,828 refusals, and ends in V8 heap exhaustion, SIGABRT, and an unhandled worker error. Those diagnostics remain explicitly included. Forty-two boundary, drain, resource-close, runner, dependency, and workflow inputs are unchanged across the four revisions. The drain retains failed items and reschedules them while fast-test mode skips debounce, explaining the downstream escalation after teardown. The historical main log proves the primary timeouts, not an identical OOM; no heap profile or precise suspended await is claimed. Both jobs used 8 CPUs / 32 GB and an 8192 MB Node heap. The ordinary durable RPC flow cannot select the added incognito binding.

The complete inherited-failure evidence includes both roots, the aggregate, actual checkout composition, source identities, passing scoped checks, and hashed logs. Landing uses the explicitly authorized native admin route. No failing test, deadline, heap limit, or assertion was weakened, and no product CI job was rerun. Earlier local WebChat probes hit different overall deadlines; their five-run comparison remained incomplete. The redundant Testbox preparation was stopped before any product test ran after matching main CI became available, and the lease is verified stopped.

ClawSweeper completed on this exact head at 2026-10-06 11:19 UTC, with no actionable findings. Its technical assessment confirms that no stored-data contract changed; the repeated migration checklist heuristic does not apply. The completed integration and SDK receipts above address its remaining evidence request.

Native routes the atomic activation must delete (P7k deletion sizing)

Estimates cover 690–855 production lines, excluding replacement code and other lanes. These anchors describe the original 4863c5b66d793 prerequisite and need refreshing during activation after the integrated main changes. Preserve worker-local memory bootstrap/schema/temp-store/lifecycle kernels, durable SDK/offline paths, detached managers, the generic merger, and transaction-local authoritative reads.

Native route File:line anchors Estimated deleted lines
Host bootstrap selection, readonly, topology src/state/openclaw-agent-db.ts:249,752; src/state/openclaw-agent-db-readonly.ts:86; src/state/openclaw-agent-db-lifecycle.ts:715,726,736 35–60
Entry/current/admission/selector src/config/sessions/session-entry-read-runtime.ts:111,226,326; session-entry-current-runtime.ts:59; session-accessor.sqlite-entry-admission.ts:179; session-entry-read-request.ts:52 80–100
Logical/candidate selection src/config/sessions/session-accessor.entry.ts:185,278,401,655 20–30
Combined discovery/consumption src/config/sessions/combined-store-gateway.ts:199,288,303,385; combined-store-gateway-read.ts:42,55,99,133 25–45
Placement evidence src/config/sessions/session-placement-evidence.ts:106,117,122,148,289 25–35
Sharing/delivery/presence/completion src/gateway/session-sharing-preparation.ts:364; src/config/sessions/session-delivery-generation.ts:221; src/gateway/presence-projection.ts:36; src/gateway/tool-resolution-completion.ts:146 125–135
DB-keyed facts and publication/owner consumers src/config/sessions/session-accessor.sqlite-incognito-sharing.ts:1; session-accessor.sqlite-entry-cache-publication.ts:47,291,307,323,332,362,394,417,420; session-accessor.sqlite-owner.ts:48,132 180–200
Manager selection/rewrite/branch src/agents/sessions/session-manager-append.ts:74; session-manager-metadata.ts:27; session-manager-entries.ts:202; session-manager-suffix-persistence.ts:60; session-manager-persistence.ts:449; session-manager-branching.ts:175,286; session-manager.ts:211,228 50–70
Static-note native fallback src/agents/sessions/session-manager-write-admission.ts:222,260,275 15–25
Native context bridge src/agents/sessions/session-manager-incognito.ts:161,207,243,251 25–38
Bound-only SDK checks and Codex native dispatch src/agents/sessions/session-manager-incognito-scope.ts:95; src/plugin-sdk/codex-session-transcript-runtime.ts:95; extensions/codex/session-history-worker-runtime.ts:123 8–15

The DB-keyed facts module can disappear only after the private-display lane removes its consumers. Do not delete the entire memory bootstrap.

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 6, 2026
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 6, 2026, 8:24 AM ET / 12:24 UTC (Revision 10).

ClawSweeper review

What this changes

The PR composes worker-owned incognito session acquisition, discovery, and live authority while preventing retained transcript readers from disclosing messages after closure.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open as a distinct, maintainer-owned prerequisite that current main does not implement. The exact-head receipts resolve the previous validation request, and no actionable introduced defect was found.

Priority: P2
Reviewed head: 752ebb4c4314ffb3787becc8b42c892a61b9cebe

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent internal refactor with strong scoped boundary evidence and no actionable correctness finding; the prior evidence request is satisfied.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The hash-matched body records completed exact-head production-worker composition and Gateway-close proof, including revoked acquisition at transaction/commit, cancelled summary reads, retained-reader closure, and captured-root lineage. Source inspection confirms rejection before writes or disclosure; these receipts cover the inactive composition, not future activation. No stored-data contract changes require migration proof. Detailed CI failure logs were inaccessible to this reviewer, which does not invalidate the separate behavior receipts.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The hash-matched body records completed exact-head production-worker composition and Gateway-close proof, including revoked acquisition at transaction/commit, cancelled summary reads, retained-reader closure, and captured-root lineage. Source inspection confirms rejection before writes or disclosure; these receipts cover the inactive composition, not future activation. No stored-data contract changes require migration proof. Detailed CI failure logs were inaccessible to this reviewer, which does not invalidate the separate behavior receipts.
Evidence reviewed 9 items Pinned introduction and clean checkout: Reviewed the complete introduced diff from e62b6f8 to the exact head. Raw head parent records match the supplied original-head identity; the supplied test merge remains a separate, stale candidate. Whitespace checking passed and the working tree remained clean.
Still distinct from current main: Current main retains the earlier binding implementation without this PR's acquisition and topology composition. The new acquisition and target-based synchronous-refusal helpers have no production callers, matching the explicitly inactive scope; the binding module is absent from v2026.9.8.
Complete captured body and review continuity: Retrieved the full body and verified SHA-256 3dfcd4fec503fda5f8739294639a9975ddc5d61bb0d516384fcf9744d1f93a91 against the captured snapshot. Its current-candidate section records 127 passing cases across nine files in 985.73 seconds, completed remaining changed-file checks, and the exact-head SDK comparison: zero entrypoint or direct declaration changes, 131 reachable changes across 24 entrypoints, digest f7fed0cf9ab6e94cb5d4174390b1d1e806067fe52d3b10728868a05fd98a5f46. These receipts address the prior review's sole retained rank-up move.
Findings None None.
Security None None.

How this fits together

Incognito sessions hold private conversation state in process-local databases. The session execution owner supplies retained worker access and current authority to session readers, sharing checks, delivery guards, and completion routing.

flowchart TD
  A[Session request] --> B[Captured actor binding]
  B --> C[Existing session execution owner]
  C --> D[Worker reads and writes]
  D --> E[Published session facts]
  E --> F[Current authority check]
  F --> G[Authorized consumption]
  F --> H[Refuse stale access]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +974, Tests +859, Docs +27, Other -1. Total +1859 across 48 files.

View PR surface stats
Area Files Added Removed Net
Source 37 1196 222 +974
Tests 9 942 83 +859
Docs 1 27 0 +27
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 48 2165 306 +1859

Review metrics

Metric Value Why it matters
Production and test growth production +974 net lines; tests and test support +857 net lines The body justifies production growth as retained acquisition and authority composition within existing owners, with native deletion deferred to atomic activation.
Released SDK surface 0 entrypoint changes; 0 direct declaration changes; 131 reachable changes across 24 entrypoints The completed exact-head comparison distinguishes internal type reachability from a released callable-contract change.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/config/sessions/session-accessor.entry.ts, serialized state: src/agents/tools/session-status-session-resolve.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep this composition inactive and preserve the existing native routes until the coordinated activation installs all adapters and removes superseded ownership together.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a standalone bug report: this is an inactive refactor, with source-backed regressions and recorded real-worker negative controls for authority and disclosure failures.

Is this the best way to solve the issue?

Yes. The patch extends the existing execution and binding owners while preserving native production routing and released synchronous contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 608f1530d231.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is bounded internal session-ownership preparation with production activation deferred and no demonstrated urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The hash-matched body records completed exact-head production-worker composition and Gateway-close proof, including revoked acquisition at transaction/commit, cancelled summary reads, retained-reader closure, and captured-root lineage. Source inspection confirms rejection before writes or disclosure; these receipts cover the inactive composition, not future activation. No stored-data contract changes require migration proof. Detailed CI failure logs were inaccessible to this reviewer, which does not invalidate the separate behavior receipts.
  • proof: sufficient: Contributor real behavior proof is sufficient. The hash-matched body records completed exact-head production-worker composition and Gateway-close proof, including revoked acquisition at transaction/commit, cancelled summary reads, retained-reader closure, and captured-root lineage. Source inspection confirms rejection before writes or disclosure; these receipts cover the inactive composition, not future activation. No stored-data contract changes require migration proof. Detailed CI failure logs were inaccessible to this reviewer, which does not invalidate the separate behavior receipts.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the complete introduced diff from e62b6f8 to the exact head. Raw head parent records match the supplied original-head identity; the supplied test merge remains a separate, stale candidate. Whitespace checking passed and the working tree remained clean. (752ebb4c4314)
  • Still distinct from current main: Current main retains the earlier binding implementation without this PR's acquisition and topology composition. The new acquisition and target-based synchronous-refusal helpers have no production callers, matching the explicitly inactive scope; the binding module is absent from v2026.9.8. (src/config/sessions/session-incognito-binding.ts:202, 608f1530d231)
  • Complete captured body and review continuity: Retrieved the full body and verified SHA-256 3dfcd4fec503fda5f8739294639a9975ddc5d61bb0d516384fcf9744d1f93a91 against the captured snapshot. Its current-candidate section records 127 passing cases across nine files in 985.73 seconds, completed remaining changed-file checks, and the exact-head SDK comparison: zero entrypoint or direct declaration changes, 131 reachable changes across 24 entrypoints, digest f7fed0cf9ab6e94cb5d4174390b1d1e806067fe52d3b10728868a05fd98a5f46. These receipts address the prior review's sole retained rank-up move. (752ebb4c4314)
  • Authority rejection before mutation: Acquisition authority is composed into command admission and rechecked around transaction and commit grants. The real-worker regression revokes that authority at each grant and verifies through a healthy reference that no session entry was written; nested acquisition also preserves outer authority and cancellation. (src/state/openclaw-agent-execution-incognito.test.ts:358, 752ebb4c4314)
  • Final disclosure boundary: The context reader checks its owner before every yielded message and closes its iterator in finally. SessionManager's durable path additionally checks the retained read owner; changed regressions verify zero disclosure after closure, cancellation, or acquisition revocation. (src/config/sessions/session-transcript-context-reader.ts:22, 752ebb4c4314)
  • Inactive scope and unchanged stored contracts: The documentation and source preserve native production acquisition until coordinated activation. Added commands reuse existing worker queries and mutation kernels; capability facts, bindings, and snapshot fences are transient. No schema, serialized format, configuration, retention, durability, or released synchronous signature change was found. Public docs: docs/reference/database-schemas/worker-access.md. (docs/reference/database-schemas/worker-access.md:779, 752ebb4c4314)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (9 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-06T00:48:29.091Z sha 4863c5b :: blocked before merge. :: none
  • reviewed 2026-10-06T01:24:31.646Z sha bbfbabd :: blocked before merge. :: none
  • reviewed 2026-10-06T01:46:28.361Z sha bbfbabd :: blocked before merge. :: none
  • reviewed 2026-10-06T06:28:42.795Z sha 5aa0ba3 :: blocked before merge. :: none
  • reviewed 2026-10-06T07:32:42.059Z sha 5aa0ba3 :: blocked before merge. :: none
  • reviewed 2026-10-06T09:19:39.474Z sha 1b969e5 :: blocked before merge. :: none
  • reviewed 2026-10-06T10:16:24.819Z sha 77a3c37 :: blocked before merge. :: none
  • reviewed 2026-10-06T11:19:22.822Z sha 752ebb4 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 6, 2026
Keep related actor acquisition independent of the mutable presentation checks and valid through settlement. Move the captured-root regression into a host-owned actor fixture at the two-worker floor, and prune the retired status-tool max-lines entry.
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Integrate the landed dependency repair, session-authority B1, and native creation writes. Move the two new internal classifier callers to the request module while retaining host-owned inactive production routing.
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 752ebb4c4314ffb3787becc8b42c892a61b9cebe
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/sandbox/runtime-status.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 6, 2026
Retain P7l operation capture alongside P7k acquisition and topology helpers.
Keep accepted-write authority distinct from read disclosure checks and retain
both inactive prerequisite sections. Production routing remains host-owned.
Carry admission cancellation in the retained summary snapshot authority so
cancelled reads cannot invoke their consumer before rejecting. Cover the race
with a real-worker regression in the existing actor-binding suite.

Integrate main's detached observer persistence and internal Runtime admission
while preserving host-owned incognito routing and released SDK boundaries.
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit d8a62a8 into main Oct 6, 2026
189 of 195 checks passed
@steipete
steipete deleted the dbasync/incogp7k branch October 6, 2026 12:28
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
… (P7k, inactive) (openclaw#165885)

* refactor(sessions): compose incognito actor acquisition and authority (P7k, inactive)

* fix(sessions): preserve related incognito read authority

Keep related actor acquisition independent of the mutable presentation checks and valid through settlement. Move the captured-root regression into a host-owned actor fixture at the two-worker floor, and prune the retired status-tool max-lines entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant