Skip to content

refactor(sessions): retain inactive incognito source authority - #166995

Merged
steipete merged 12 commits into
mainfrom
dbasync/incogp01
Oct 8, 2026
Merged

steipete merged 12 commits into
mainfrom
dbasync/incogp01

Conversation

@steipete

@steipete steipete commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

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.

Audit ID Closed here under explicit binding
G1 Retained source authority through the real Gateway sharing, authorization, admission, and worker-grant consumers.
SS15 Exact physical target identity, including keyless targets, root A under ambient root B, and conflicting enclosing bindings.
I3 Bounded current delivery facts, synchronous approval account/target consumers, and live revocation.

“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, tree fc60e490d73159306a40fde926112d76406529fb; comparison base 961f5c0b709962bd1338edb4d71559583fbd4f2f. Focused/static/SQL proof used carrier 9ac56fadb0e4028d1e48ed04b8871c78321f5808; update proof used carrier c8c61807743776b0ed1ad457116473a5e8dd23ff. 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.

Focused command: pnpm test <group files> --maxWorkers=1 Files / tests Wall seconds
Actor source/history/lifecycle 7 / 120 84.18
Sharing, physical targets, approvals 10 / 126 113.34
Completion, admission, CLI/context engine, cleanup 14 / 267 308.28
Import boundaries 5 / 17 35.97
Exact focused test commands
# focused-actor-source: 84.18s
pnpm test src/state/openclaw-agent-execution-incognito.history.test.ts src/state/openclaw-agent-execution-incognito.sessions.test.ts src/state/openclaw-agent-execution-incognito.creation.test.ts src/state/openclaw-agent-execution-incognito.entry-patch.test.ts src/state/openclaw-agent-execution-incognito.lifecycle.test.ts src/state/openclaw-agent-execution-incognito.side-data.test.ts src/state/openclaw-agent-execution-incognito.completion-lineage.test.ts --maxWorkers=1

# focused-completion-consumers: 308.28s
pnpm test src/agents/agent-harness-completion-delivery.test.ts src/agents/agent-harness-completion-ownership.test.ts src/agents/agent-harness-completion-authority.test.ts src/agents/admitted-run-context.test.ts src/agents/agent-command-execution-identity.test.ts src/agents/agent-command.restart-settlement.test.ts src/agents/cli-runner.context-engine.test.ts src/agents/harness/context-engine-lifecycle.test.ts src/config/sessions/session-entry-patch.test.ts src/config/sessions/session-cold-storage.lifecycle.test.ts src/config/sessions/session-source-authority.test.ts src/agents/harness/context-engine-source-scope.test.ts src/agents/command/delivery.custody.integration.test.ts src/agents/main-session-recovery/main-session-restart-abort.integration.test.ts --maxWorkers=1

# focused-imports: 35.97s
pnpm test test/scripts/runtime-process-build-graph.test.ts src/auto-reply/reply/get-reply.imports.test.ts src/config/sessions/session-history-read.imports.test.ts src/config/sessions/session-transcript-reconcile.imports.test.ts src/state/openclaw-state.worker.imports.test.ts --maxWorkers=1

# focused-sharing-target: 113.34s
pnpm test src/gateway/session-sharing.incognito.test.ts src/gateway/session-sharing.worker.test.ts src/gateway/session-sharing.prepared.test.ts src/gateway/session-sharing-preparation.test.ts src/gateway/session-sharing-preparation.admission.test.ts src/gateway/session-sharing.test.ts src/config/sessions/session-accessor.sqlite-scope.test.ts src/infra/exec-approval-session-target.incognito.test.ts src/infra/exec-approval-session-target.test.ts src/gateway/session-sharing-committed-read.test.ts --maxWorkers=1
Required gate Current-source result
node scripts/check-changed.mjs --base <base> PASS, 3,674.70s
pnpm check:madge-import-cycles PASS, 18.36s
pnpm deadcode:knip PASS, 54.07s
pnpm check:database-worker-ratchet --base <base> PASS, 3.35s
T1 inventory 800 → 800, 262 files; 5.17s
pnpm plugin-sdk:api:diff --base <base> --head HEAD PASS, 632.67s; digest b6559f37
Fresh isolated Codex P2 review Scoped-clean on the full integrated diff with complete owner-module context
Regression negative controls Baseline approval selection, CLI fenced bootstrap, and physical-root cases fail at the intended behavior; 31.74s / 27.37s / 26.14s
Alternating all-thread SQL measurement PASS with attributed +0.079% warmed noise under the coordinator rule below
Published-driver × candidate update PASS: published 2026.9.8 updater exit 0, candidate build verified, readiness 200, durable history identical, incognito history cleared; package 267.46s, cell 238.94s, updater 190.36s

SDK 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.

Phase Main median Candidate median Delta
Boot 2,758 2,758 0
Connect 392 392 0
First turn 4,493 4,493 0
Warmed mean per turn 1,512.3 1,513.5 +1.2 (+0.07935%)
Second session 5,239 5,238 −1
Control plane 53 49 −4
Cron 1,448 1,431 −17
Compaction 852 848 −4
Shutdown 1,084 1,081 −3
Total, context only 31,430 31,433 +3

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.

Unchanged owner Pair 1 delta Pair 2 delta Pair 3 delta
Session-row database facts/cache +18 +11 +2
Device-pairing snapshot +5 0 0
Shared-state reader freshness/cache +1 +8 +8
Shared-state writer schema cache 0 +2 0
Exact-session lifecycle cache −7 −1 +5
Exact-session entry cache −3 +3 −6
ACP metadata cache −2 0 −1
Native participant cache 0 0 −2
Audit writer schema cache 0 0 +2
Placement-claims schema cache 0 −2 −2
Net per ten-turn window +12 +21 +6

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:

Combined window Main runs Candidate runs Median main → candidate
Boot + connect 3158, 3147, 3150 3153, 3139, 3150 3150 → 3150
Control + cron 1511, 1501, 1481 1473, 1480, 1496 1501 → 1480
Compaction + shutdown 1949, 1933, 1936 1933, 1929, 1929 1936 → 1929

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.md remains release-owned. Production activation remains deferred to P12.

Landing integration and correction

First landing candidate: c3405f491f29bab19f5703ec6b5b6d1b4ce7b3fb. Main was merged at 4099058e3a8658d45ef8d4f0f125e843f07e4dec for 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.9 and v2026.9.8 expose no SDK/runtime export for it.

The real-binder regression failed before the fix with SESSION_WORK_START_CHANGED at 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 main bd90c1bbe666afd0c728155f53375050ec6293cf. 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 (pending instead of blocked, 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 is e0bfc6e00cbc0d96393708d22a2d7cbadee3655a.

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 main ff9e8818527accde219a9e4da9c7e0ea25a2f04c preserves 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 3c4f6aaa53ee on 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 e5d25c80247b256c4eb40e904bc69a8542fee549 in merge ab625cdb6eec2bd01e025c10d31a5cfdd5948a06, over main 85f4efc70fd1e778291167c872deb8ef09f27e33. 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.ts expected 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 79e33e8471a5ffdb8cf5b6405d11097d4bf8b576 on October 8, 2026 at 18:56 UTC. The exact-head receipt and landing-parent audit matched. Final ClawSweeper review of e5d25c80247b2 completed 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 8, 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.

@github-actions

github-actions Bot commented Oct 8, 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: e5d25c80247b256c4eb40e904bc69a8542fee549
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/infra/exec-approval-session-target.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XL labels Oct 8, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 2:50 PM ET / 18:50 UTC (Revision 7).

ClawSweeper review

What this changes

The branch retains explicitly bound incognito session authority through sharing, approval routing, completion preparation, and cleanup while preserving captured storage roots.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation has useful owner-boundary regression coverage and no identified blocker, while proof of the inactive composition remains harness-based.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This maintainer-owned inactive prerequisite is outside the external-contributor proof gate. Real-worker harnesses exercise the changed actor, sharing, approval, and completion owners; they establish explicit-binding composition rather than shipped activation. Source inspection verifies no stored-data migration is needed, and the recorded published-driver update preserves durable history.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: This continues the existing area's owner-directed inactive worker cutover and prepares complete consumer lifetimes without activating another production writer.

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
Reviewed head: e5d25c80247b256c4eb40e904bc69a8542fee549

Before merge

None.

Findings

None.

Agent review details

How this fits together

Incognito 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]
Loading

Technical review

Best 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

  • src/config/sessions/session-incognito-authority.ts and session-incognito-actor.ts keeps the original intent (d8a62a8: Prepare actor acquisition and authority as an inactive prerequisite while retaining native production ownership and joining accepted work before release.)
  • src/config/sessions/session-source-authority.ts and Gateway sharing source/grant consumers keeps the original intent (48c022a: Carry prepared physical source facts through consumers and revalidate live authority at admission, commit, and settlement.)
  • src/agents/agent-harness-completion-recovery.ts and agent-harness-completion-delivery.ts keeps the original intent (6caadad: Recover only still-owed admitted completions while preserving exact requester lifecycle, original input, delivery identity, and rejection of intervening human work.)
  • src/agents/command/cleanup.ts keeps the original intent (10334ec: Persist terminal run outcomes while deriving liveness from the run registry and retaining recovery ownership.)
  • src/agents/harness/context-engine-lifecycle.ts keeps the original intent (cc42bb1: Share lifecycle input types while preserving public names, runtime settings, ordering, transcript fences, and callback contracts.)
  • src/config/sessions/session-accessor.sqlite-scope.ts, src/state/openclaw-agent-db.paths.ts, and memory corpus discovery keeps the original intent (dbd3bf7: Prepare hydration through existing workers while keeping captured session, storage environment, and manager ownership current.)
  • src/infra/approval-request-account-binding.ts and exec-approval-session-target.ts keeps the original intent (unknown: The git log -S search encountered unavailable promisor blobs (HTTP 403), so exact helper introduction remains unknown. The inspected merged account-custody PR establishes the existing routing contract.)

Testing

Proof path: in-process harness. Added test files: 25.

Security

None.

Evidence

What I checked:

Likely related people:

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

PR surface

Source +1051, Tests +1741, Docs +28, Other -1. Total +2819 across 60 files.

View PR surface stats
Area Files Added Removed Net
Source 33 1534 483 +1051
Tests 25 1811 70 +1741
Docs 1 28 0 +28
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 60 3373 554 +2819

Review metrics

Metric Value Why it matters
SDK declaration review 17 distinct deltas inspected; 0 entrypoints or exports added or removed The recorded comparison distinguishes optional reachable type changes from a breaking public API cutover.

Stored data model

Persistent data-model change detected: serialized state: src/agents/agent-command-restart-recovery.ts, serialized state: src/infra/exec-approval-session-target.ts, unknown-data-model-change: src/agents/agent-command-restart-recovery.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/openclaw-runtime-session.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is bounded session-authority groundwork with production activation intentionally deferred.
  • merge-risk: 🚨 compatibility: Reachable SDK declarations gain optional source-scope inputs; the recorded owner review and API comparison cover compatibility without an unresolved contract break.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-08T06:06:53.786Z sha f4e7c9e :: blocked before merge. :: none
  • reviewed 2026-10-08T06:48:45.468Z sha f4e7c9e :: blocked before merge. :: none
  • reviewed 2026-10-08T07:41:14.239Z sha f4e7c9e :: blocked before merge. :: none
  • reviewed 2026-10-08T17:09:14.326Z sha f4e7c9e :: needs changes before merge. :: none
  • reviewed 2026-10-08T17:29:22.186Z sha c3405f4 :: blocked before merge. :: none
  • reviewed 2026-10-08T17:52:01.473Z sha 3c4f6aa :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot closed this Oct 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 8, 2026
@openclaw-barnacle openclaw-barnacle Bot closed this Oct 8, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 8, 2026
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.
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 8, 2026
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.
@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 8, 2026
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.
@steipete
steipete merged commit 79e33e8 into main Oct 8, 2026
172 of 175 checks passed
@steipete
steipete deleted the dbasync/incogp01 branch October 8, 2026 18:56
@steipete

steipete commented Oct 8, 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 9, 2026
…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.
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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