Repository navigation
refactor(sessions): retain inactive incognito source authority - #166995
Conversation
Prepare the explicitly bound actor arm for sharing, completion fences, physical targets, and bounded approval routing. Production incognito acquisition remains host-owned until P12; native selectors remain in place. Closes the inactive contracts for audit G1, SS15, and I3, pending final validation. No schema, durability, retention, permission, or SDK migration.
Preserve the worker-grant sharing consumer from #166444 and route explicitly bound actors through the retained source owner. Keep production incognito acquisition host-owned and retain native selectors until P12.
Remove sharing dependency cycles by keeping binding classification with the incognito fact owner. Register actor fixtures with their existing host-process suites, validate real reset and persisted branch invalidation, and preserve grant-local transaction preimage coverage. Shrink the retired approval mock baseline entry. Keep production incognito acquisition host-owned and retain native selectors until P12.
Let command cleanup join its consumers before releasing retained completion authority. Preserve the original command or cleanup failure as the aggregate cause when release also fails; leave unbound cleanup behavior unchanged. Prove both failure paths through Gateway ingress and retain receiver-safe callbacks and canonical typed test fixtures. Production incognito acquisition remains host-owned until P12.
Preserve both completion-source failure regressions and the main image follow-up cases. Retain current CLI delivery binding-replacement handling while keeping the inactive incognito source boundary unchanged.
|
🦞👀 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 8, 2026, 2:50 PM ET / 18:50 UTC (Revision 7). ClawSweeper reviewWhat this changesThe branch retains explicitly bound incognito session authority through sharing, approval routing, completion preparation, and cleanup while preserving captured storage roots. Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this owner-directed prerequisite remains distinct from current main, and no blocking code defect was found. The earlier compatibility-proof blocker is resolved. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherIncognito conversations keep session history in process-local storage. Sharing, approval routing, and agent completion consume that storage owner's current identity and permission facts before reading or writing. flowchart TD
A[Session operation] --> B{Explicit actor binding?}
B -->|No| C[Existing native owner]
B -->|Yes| D[Captured incognito owner]
D --> E[Current identity and transcript fence]
E --> F[Sharing approvals and completion]
F --> G[Guarded write or disclosure]
G --> H[Settle work and release source]
Technical reviewBest possible solution: Retain this inactive composition within the existing session owner and leave production activation and native-path retirement to the coordinated P12 cutover. Do we have a high-confidence way to reproduce the issue? Not applicable to a shipped user bug: this is inactive composition work, supported by inspected real-worker regressions and recorded negative controls. Is this the best way to solve the issue? Yes: the branch extends the existing source and actor owners, preserves native unbound behavior, and scopes completion validity to the exact transcript fence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9324ed61ca56. Provenance checked
TestingProof path: in-process harness. Added test files: 25. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1051, Tests +1741, Docs +28, Other -1. Total +2819 across 60 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (6 earlier review cycles)
|
Integrate main while preserving stopped-command claim handling and retained incognito source cleanup. Make the command binder prepare and retain an exact completion source before its first assertion, and cover valid recovery, invalid input, and caller revocation through the real binder. Production incognito acquisition remains host-owned.
Integrate the landed raw and visible transcript delta operations alongside the retained completion-source operations. Require committed input when reconciling an actor completion without live custody, while preserving the existing pre-input exception for live admission. Cover the original-run claim before and after its input commits.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Do not pass the internally captured ambient environment as an explicit physical-target constraint. Align CLI and incognito fixtures with required recorder methods, grant-local facts, inferred physical owners, and early target mismatch refusal. Preserve revocation, no-append, and no-misrouting assertions.
Preserve main opaque-check metadata alongside the reviewed scoped-source implementation. Resolve the real merge conflict without changing either owner contract. Focused source authority, manual compaction, and SQLite scope tests pass.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…law#166995) * refactor(sessions): retain inactive incognito source authority Prepare the explicitly bound actor arm for sharing, completion fences, physical targets, and bounded approval routing. Production incognito acquisition remains host-owned until P12; native selectors remain in place. Closes the inactive contracts for audit G1, SS15, and I3, pending final validation. No schema, durability, retention, permission, or SDK migration. * refactor(sessions): isolate incognito sharing facts Remove sharing dependency cycles by keeping binding classification with the incognito fact owner. Register actor fixtures with their existing host-process suites, validate real reset and persisted branch invalidation, and preserve grant-local transaction preimage coverage. Shrink the retired approval mock baseline entry. Keep production incognito acquisition host-owned and retain native selectors until P12. * fix(sessions): preserve completion errors during source cleanup Let command cleanup join its consumers before releasing retained completion authority. Preserve the original command or cleanup failure as the aggregate cause when release also fails; leave unbound cleanup behavior unchanged. Prove both failure paths through Gateway ingress and retain receiver-safe callbacks and canonical typed test fixtures. Production incognito acquisition remains host-owned until P12. * test(sessions): type retained approval fixture * test(gateway): join retained sharing source release * fix(sessions): preserve configured incognito roots in memory discovery Do not pass the internally captured ambient environment as an explicit physical-target constraint. Align CLI and incognito fixtures with required recorder methods, grant-local facts, inferred physical owners, and early target mismatch refusal. Preserve revocation, no-append, and no-misrouting assertions.
What Problem This Solves
Explicitly bound incognito actors need to retain the same source authority across sharing, approval routing, and asynchronous harness completion. A source-wide validity bit cannot distinguish permitted fenced human input or the completion's own append from an unfenced input, reset, branch, or rewrite. An explicit private-store target must also retain its physical root across ambient environment changes, including keyless targets.
P01 prepares those contracts while production incognito acquisition remains host-owned. Ordinary unbound calls preserve native behavior and allocate no actor. This follows the inactive prerequisite pattern of P7k (#165885), P7l (#165895), P7m (#165890, #165901), and P7n (#166265). No feature flag, second live writer, new worker service, schema, durability, retention, permission, content-cap, or breaking supported SDK change is introduced.
Owner boundary and audit closure
The canonical session source owns captured physical identity, current actor authority, bounded acknowledged facts, and scoped preparation/release. Gateway sharing adapts that owner through the actual sharing, admission, and worker-grant consumers. Synchronous approval selectors consume current
{sessionId, updatedAt, delivery}facts; grant callbacks add neither host SQL nor actor RPC.Each completion source has its own exact transcript fence, registration, transaction/precommit validity, and release. CLI and context-engine preparation carry that scope through the consumer chain. Accepted consumers and terminal-write settlement finish before source release. Cleanup preserves the primary failure when release also fails. Explicit target mismatches are refused rather than redirected to an ambient root; missing reads create nothing and never fall through to durable discovery.
“Closed” means the actor arm and complete consumer contract are ready under explicit binding. P12 still owns production selection and native deletion: automatic unbound actor acquisition, unbound topology enumeration, target-wide synchronous refusal, and removal of native selectors, necessary imports/tests, bridges, and database-keyed facts. Unbound native behavior is not an actor-selected absence. Shared dependency IDs are not charged again. No incognito T1 retirement is claimed.
Source and size
Original approved candidate
f4e7c9eaf2d62ebefa3ad3beb2e06c9dee212a7f, treefc60e490d73159306a40fde926112d76406529fb; comparison base961f5c0b709962bd1338edb4d71559583fbd4f2f. Focused/static/SQL proof used carrier9ac56fadb0e4028d1e48ed04b8871c78321f5808; update proof used carrierc8c61807743776b0ed1ad457116473a5e8dd23ff. Both have the identical candidate tree. Main was integrated for an actual overlapping recovery conflict; the merged source retains main's operator recovery metadata and P01's scope ownership.Production: 1,529 additions + 472 deletions = 2,001 changed lines across 31 files. Tests/support: 1,666 additions + 53 deletions across 17 files. Docs: 28 additions in one file. Tooling/baseline: 2 additions + 1 deletion across three files. The baseline change removes one retired mock-export entry; no baseline expands. The preserved atomic draft remained read-only; only P01 semantic hunks were ported.
Evidence
All 530 tests across 36 files passed on the integrated candidate. Explicit-binding tests cover fenced later human input, unfenced later input, own assistant append, reset/branch/rewrite revocation, release, accepted settlement, queued actor replacement, approval delivery/revocation, captured physical roots, host-SQL refusal in the bound arm, and ordinary host-owned unbound behavior. Durable siblings remain covered.
pnpm test <group files> --maxWorkers=1Exact focused test commands
node scripts/check-changed.mjs --base <base>pnpm check:madge-import-cyclespnpm deadcode:knippnpm check:database-worker-ratchet --base <base>pnpm plugin-sdk:api:diff --base <base> --head HEADb6559f372026.9.8updater exit 0, candidate build verified, readiness 200, durable history identical, incognito history cleared; package 267.46s, cell 238.94s, updater 190.36sSDK review: 135 affected exports across 24 entrypoints, comprising 134 reachable changes and one compatible parameter alias. All 14 distinct reachable declaration changes were inspected. No added/removed entrypoints or exported names; no supported contract break. Added scope inputs are optional and existing required parameters/return types are preserved.
The integrated focused/static/negative/SQL run is AWS Crabbox run_301f0e0e61d471dcf84d92de9dae66d6: c7a.2xlarge, 8 CPUs, Node 24.19.0, pnpm 12.5.1. Payload wall 5,767.61s; wrapper wall 6,939.87s. Its exit 1 deliberately pauses strict SQL arithmetic for attribution review; the qualified decision below is separate and preserves the original receipt. Update proof runs separately. Focused command wall totals 541.77 seconds on this self-hosted AWS runner; hosted-CI billed seconds and per-task dollar cost are unavailable, not zero.
Earlier attempts exposed and fixed a widened approval fixture type and unawaited sharing-source release promises. Current-source full checks pass after those repairs and main integration. Testbox initially queued for 15 minutes, then the authorized AWS fallback was used. Standard Actions-runner hydration repaired workspace admission; failed pre-execution attempts are not counted as test passes. Resource admission required 12 AWS fleet-cap refusals (
21/20) plus proof-slot waits. A fresh Testbox warmup encountered a CLI I/O completion error and was independently confirmed stopped; its reconciled retry succeeded. Approximately 4h52 elapsed from the first fleet refusal to successful Testbox allocation, including the brief earlier disk pause. All later remote work used the shared proof-slot owner; its coordinator-approved limit increased from four to six. The final Testbox is confirmed completed after native cleanup.The final update ran on Blacksmith Testbox workflow 37731529866, lease
tbx_01m4cz1jer43x69n0tnyabrzzn, with 4 visible CPUs, Node 24.19.0 and pnpm 12.5.1. Payload wall was 514.63s and wrapper wall 1,339.82s. GitHub reports 1,830s workflow duration and zero GitHub-hosted billable milliseconds for this Testbox run; provider dollar cost is unavailable, so this is not a zero-cost claim. Package SHA-256:c7b521d52d302dd77c9d37e08bbb3275d7bfbfad572dcead768f12b744bb6e2e. Downloaded evidence SHA-256:12adbd65c5bfe54cd109c21e898e7e28bc9727d5e2d91dc045c850a446f29943, independently verified. Artifact download required the documented Crabbox-owned SSH key option; this was recovered without rerunning the update.The synthetic update fixture emitted nonfatal Doctor route/loopback/service-membership warnings. Its status probe lacks
operator.read; the handshake candidate build ID, dedicated readiness, durable-history equality, and incognito clearing checks independently passed. No production deployment or release occurred.SQL statement table and attribution
Three alternating pairs in B,C,B,C,B,C order ran on one host with unchanged built worktrees. These are raw all-thread side medians; total statements are context only. All gated median duration ratios are below 1.5 (range 0.9964–1.0242); warmed ratio is 1.00326.
Warmed samples: main
[1512.3, 1511.7, 1512.7], candidate[1513.5, 1513.8, 1513.3]. All 35 SQL/method/full-stack groups positive in any warmed pair already occur in baseline evidence. All 42 source files in those stacks and inspected producers have identical base/candidate blobs. Independent raw recount confirms 53 PR-touched-stack statements in every one of the six runs, with no increased touched group. Main-thread counts are 65 and helper-process counts 312 in every warmed ten-turn window; the entire variation is in existing worker reads/caches.The representative median pair's five pairing-snapshot statements shift from cron to warmed turn 6. Other variation follows existing data-version/schema/read-revision caches and queued/coalesced projection reads. Raw worker IDs, sites, stacks, absolute phase windows, and source blob comparisons are retained with the attribution receipt. This qualifies under the coordinator's ≤0.5% turn-noise rule only for attributed untouched owners; no new SQL/stack group or increased PR-touched stack was observed. The increase is not labeled entirely background: existing foreground reader cache misses are included.
Adjacent combined sums are reported without combining either turn gate:
Limits and release-note context
The SQL observer supports worker/stack correlation to nominal timestamped phase windows, not exact query timestamps or a request-envelope census. It cannot identify every cache-miss interleaving or prove sender causality. Source/build metadata, stamps, and source maps were rechecked between cells; this is not a hash seal of every executed JavaScript file. Known shutdown-only restart-intent lock diagnostics remain a separate campaign follow-up. Hosted CI is advisory; no rerun or extra push is requested merely for green.
Release-note context: inactive groundwork for retained incognito sharing, approval routing, and exact harness-completion source fences. Production remains host-owned until P12. Explicit physical targets preserve their captured root; cleanup preserves the primary error when source release also fails.
CHANGELOG.mdremains release-owned. Production activation remains deferred to P12.Landing integration and correction
First landing candidate:
c3405f491f29bab19f5703ec6b5b6d1b4ce7b3fb. Main was merged at4099058e3a8658d45ef8d4f0f125e843f07e4decfor actual conflicts. The resolution preserves the stopped-command claim handling from #166968 together with retained-source cleanup; both sets of tests remain.Fresh P2 review identified that the command binder checked a resumed incognito completion before preparing its exact source scope. A recovery run legitimately has a different operational run ID from the original completion source. The binder now owns asynchronous preparation, validates the prepared source, and returns custody to the command's existing terminal cleanup. The separate preparation helper was removed. The binder is internal; stable
v2026.9.9andv2026.9.8expose no SDK/runtime export for it.The real-binder regression failed before the fix with
SESSION_WORK_START_CHANGEDat the immediate assertion (152.83s command wall time). The fixed suite accepts valid recovery, rejects intervening human input, and preserves caller revocation.pnpm test src/state/openclaw-agent-execution-incognito.history.test.ts src/agents/agent-command.restart-settlement.test.ts src/agents/command/delivery.custody.integration.test.ts --maxWorkers=1: 86 tests in 3 files passed, 646.28s command wall time (430.69s Vitest duration; this host was loaded). Hosted CI seconds are pending, not zero. Production typechecking and all core-test typecheck shards passed. Fresh isolated Codex P2 review of the complete integrated candidate is clean.The earlier valid alternating SQL proof and its unchanged-owner attribution above are reused under the maintainer's landing acceleration policy. No SQL remeasurement was performed. The conflict resolution and binder correction preserve the inactive boundary; ordinary unbound production remains host-owned. The source-scope ordering correction adds no new SQL statement or owner.
Final candidate
Previous tested candidate:
3c4f6aaa53ee9bbebf51113dea72b501e4810ac5. A second real-conflict merge incorporated mainbd90c1bbe666afd0c728155f53375050ec6293cf. The overlap with #166293 was additive: both its raw/visible delta operations and P01's completion-source operations are retained. No SQL-path algorithm was changed by that resolution.A second P2 finding exposed an original-run claim with no live owner and no committed input being classified as pending. The existing kernel reader now distinguishes live admission from committed-input reconciliation; the actor reconciler selects committed input, and the live-admission exception remains intact. A real-owner regression failed before the fix (
pendinginstead ofblocked, 113.89s command wall), then proved blocked-before-input and pending-after-valid-input.pnpm test src/state/openclaw-agent-execution-incognito.history.test.ts src/agents/agent-harness-completion-delivery.test.ts src/agents/agent-harness-completion-ownership.test.ts --maxWorkers=1: 104 tests in 3 files passed, 363.06s command wall. The integrated actor/import/build-graph selection also passed 64 tests in 6 files, 265.68s wall. Fresh full-candidate isolated Codex P2 review is clean. Final typecheck and SDK comparison completion are being recorded separately; earlier evidence above retains its original source binding. Required GitHub CI and ClawSweeper will bind this exact head.CI repairs and current landing head
Current candidate:
e5d25c80247b256c4eb40e904bc69a8542fee549. The five failing jobs in CI run 37818823469 were PR-related and were repaired, not classified as inherited or rerun for green. Memory corpus discovery now lets the configured physical sentinel select its root rather than passing an internally captured ambient environment as an explicit constraint. Test fixtures now use the required recorder interface and preserve meaningful owner/data, mismatch-refusal, transaction/commit revocation, and no-append assertions under P01's intended contracts. The repair ise0bfc6e00cbc0d96393708d22a2d7cbadee3655a.All six affected files passed together: 98 tests,
pnpm test src/agents/cli-runner.before-agent-reply-cron.test.ts src/agents/sessions/session-manager-incognito.test.ts src/state/openclaw-agent-execution-incognito.outbox.test.ts src/config/sessions/session-logical-entry-read.worker.test.ts src/config/sessions/session-sharing-store.incognito.test.ts src/state/openclaw-agent-execution-incognito.memory.test.ts --maxWorkers=1, 90.59s wall. Fresh isolated P2 review of the repair delta is clean. A conflict-only merge of mainff9e8818527accde219a9e4da9c7e0ea25a2f04cpreserves its opaque-check metadata alongside scoped source authority; 22 focused tests in 3 files (source authority, manual compaction and SQLite scope) passed in 50.33s. No full-suite or SQL remeasurement was performed for that conflict-only merge.The local SDK comparison completed both pinned declaration renders and produced report digest
5ebf7b21(bd90c1bbe666→3c4f6aaa53ee). All 17 distinct declaration deltas were inspected: 185 affected exports across 28 subpaths, no added/removed entrypoints or exports, and no supported contract break. The single signature spelling change extracts an equivalent assembly parameter alias with optional scope inputs. Later repairs change an implementation body and tests, while the conflict resolution preserves upstream metadata; they introduce no additional supported signature change. The report is reused. Both SDK temporary worktrees were removed; the original command was interrupted during cleanup after complete report generation, so its final process exit is unavailable rather than reported as zero.ClawSweeper reviewed
3c4f6aaa53eeon October 8 at 17:52 UTC with no code findings. Its compatibility-proof item is covered by the published-driver update proof above: subsequent changes touch no stored format, schema, migration, retention, or durability contract. Earlier reviewed code and addressed findings are reused under the maintainer's landing acceleration v3 policy; another ClawSweeper run is not a landing prerequisite. Required CI and security remain bound to the current head.Final CI disposition
CI run 37824090495 tests
e5d25c80247b256c4eb40e904bc69a8542fee549in mergeab625cdb6eec2bd01e025c10d31a5cfdd5948a06, over main85f4efc70fd1e778291167c872deb8ef09f27e33. All PR-scoped checks and security-fast passed. The sole test failure is UI E2E shard 3/7:ui/src/e2e/activity-session-refresh.e2e.test.tsexpected one.activity-entry, observed zero, and timed out. That test installs a mock Gateway; it does not execute the changed incognito owners. Its UI/runtime, dependency and workflow inputs are unchanged by this PR.This is qualified for the explicitly authorized unrelated-failure admin exception under landing acceleration v2/v3. It was not reproduced or rerun. Recent scheduled main run 37817291375 was inspected for context: it failed overall but its bundled UI shards passed, so no claim is made that this exact failure recurred on main. Admission instead relies on the authorized untouched-and-unrelated branch and independently inspected mocked-browser boundary. CI remains recorded as failed, not relabeled green.
Merged through the native admin workflow as
79e33e8471a5ffdb8cf5b6405d11097d4bf8b576on October 8, 2026 at 18:56 UTC. The exact-head receipt and landing-parent audit matched. Final ClawSweeper review ofe5d25c80247b2completed at 18:50 UTC with no code findings. CI retains the qualified unrelated UI failure: 80 successful jobs, 22 skipped jobs, one UI failure and its downstream aggregate. Summed non-skipped job duration was 21,151 job-seconds (parallel job wall time, not elapsed campaign time or a billing estimate); provider billing is unavailable.