Repository navigation
refactor(sessions): compose compute and fork paths on the incognito actor (P7f2, inactive) - #165217
Conversation
Retain the original actor through deferred reconciliation, usage reports and parent forks. Keep production routing host-owned for the atomic activation follow-up, with no schema, retention or durability change.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 1:43 AM ET / 05:43 UTC (Revision 12). ClawSweeper reviewWhat this changesThe PR composes transcript reconciliation, usage reports, and parent-session forks through the incognito session worker while retaining host-owned production routing. Merge readiness✅ Ready for maintainer review Keep open: current main does not contain the complete inactive actor composition, and the reviewed patch has no actionable introduced defect. The supplied boundary evidence supports the change without requiring another repair cycle. Priority: P2 Review scores
Verification
How this fits togetherIncognito sessions hold temporary conversation data in a process-owned SQLite database. The actor serializes database operations and supplies transcript projections, usage results, and forked conversation data to their existing consumers. flowchart TD
A[Temporary session data] --> B[Captured incognito actor]
C[Current caller authority] --> B
B --> D[Serialized worker operations]
D --> E[Transcript reconciliation]
D --> F[Usage reports and parent forks]
E --> G[Published results and exact cleanup]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +895, Tests +842, Docs +21. Total +1758 across 24 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Preserve the existing actor and storage owners, then remove retained host paths together when the separately scoped production activation is ready. Do we have a high-confidence way to reproduce the issue? Not applicable to the overall refactor; the supplied real-worker regression establishes the scheduler-yield failure and after-fix recovery, but this review did not execute it. Is this the best way to solve the issue? Yes: the patch composes existing actor and storage kernels, preserves independent cache ownership, and refreshes reconciliation sources after yields without activating a competing production path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 439cde79c612. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (11 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The fixture-capacity finding is repaired in 6fd62ff. Five original-head runs reproduced both overloaded failures with the two-slot broker budget; five merge-base runs passed. The second actor now exists only for cross-actor cases, and the corrected file passes all 20 tests under the same budget. Production capacity and assertions are unchanged. P2 autoreview is clean. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The repaired parent is merged and integrated at ddbac4a. Parent-owned conflicted code is unchanged from main. The combined candidate passed 106 focused tests plus the compiled-wrapper inventory check, and a fresh full-delta P2 autoreview is clean. The final released-SDK comparison is running locally; exact-head CI is attached separately. Production routing remains inactive. |
|
🦞👀 Re-review progress:
|
Integrate main without rebasing. Retain the actor across reconciliation while refreshing pending inventory and framing sources for each resumed planning pass. A real-worker regression reproduces the stale projection after a rewrite between finalization and the yield acknowledgement. Keep the existing scheduler policy and consolidate repeated test observers without reducing coverage.
Preserve both inactive actor compositions and the existing P7f1 documentation anchor. The introduced production delta is unchanged from the reviewed scheduler-yield repair; shared actor, pending-input, side-data, and import checks pass.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…ctor (P7f2, inactive) (openclaw#165217) * refactor(sessions): compose incognito history and manager reads * refactor(sessions): compose inactive incognito compute and fork paths Retain the original actor through deferred reconciliation, usage reports and parent forks. Keep production routing host-owned for the atomic activation follow-up, with no schema, retention or durability change. * test(sessions): scope incognito compute fixture actors * refactor(sessions): keep compute claims with their scope
What Problem This Solves
The inactive incognito actor needs complete reconciliation, usage-reporting, and parent-fork composition before production can switch to worker ownership.
User Impact
There is no user-visible activation in this PR. Production routing stays host-owned. Schemas, retention, durability, session deadlines, permissions, configuration, and update behavior are unchanged; no environment names or T1 reductions are introduced. The existing synchronous paths remain for the explicit inactive prerequisite and must be removed during the atomic cutover. No operator migration or published-driver update cell is required.
Why This Change Was Made
P7f2 retains the original actor through deferred reconciliation, coalesced passes, readiness waits, usage consumers, forks, and exact cleanup. Individual extraction and publication commands take their own FIFO turn, so dependent compute does not wait on a queue it holds. Usage retains the selected physical cache owner, including a durable cache paired with an incognito transcript, and rechecks selected-session authority after asynchronous pricing. Forks reuse the existing same-store transaction and source-first cross-agent kernels.
Main's newly landed fair scheduler can yield between sessions. Each resumed actor pass now refreshes its pending inventory and framing sources while retaining the actor across the whole operation. Reusing the original sources could otherwise return successfully while a transcript rewritten during the yield remained unindexed.
The repaired parent #165134 is integrated. The lane preserves the behavior from #165207 and #165221; the #165151 overlap is integrated without changing its pending-input/collaboration ownership. The #165218 startup-maintenance integration retains its cancellation and authority parameters in the extracted readiness owner and preserves its centralized memory capture and encoded FTS publication. The incidental #165198 cleanup is preserved. Earlier related work includes #162433, #164922, and #164989. Only this PR's branch is modified.
Evidence
Published candidate:
aa85ccfa21b8b51d02146b14785b8a0b77f4e1d9. Main throughddf95b6c52db452426f56a62d46962284b2d5f31is integrated with merge commits. Exact-head CI 37266960600 is green without reruns. ClawSweeper completed on this head at 2026-10-05T05:20:41.986Z with no findings or before-merge actions. The released-SDK comparison exited successfully for this head (digestdbeef355); native preparation and merge admission are next.Actor compute suite: 21 passed,
node scripts/run-vitest.mjs src/state/openclaw-agent-execution-incognito.compute.test.ts --maxWorkers=1, 390.51 s wall on the loaded local host, including 226.394 s of compiled-worker preparation. The new yield regression itself took 1.753 s. The same suite passed with the broker's two-slot hardware budget.Scheduler, readiness, bootstrap, native-memory reconciliation, runtime build graph, import closure, and real Gateway-close siblings: 57 passed in 8 files; 521.88 s wall, with
--maxWorkers=1. The real close case took 14.255 s and proves accepted publication and cleanup before actor teardown.Four cases affected by consolidating repeated test observers: 4 passed; 66.50 s wall with
--maxWorkers=1. No assertions or coverage were removed. The line-cap ratchet passes against integrated main8edaa95d9589ccae0284c47faba659adf62b9fa9, without an exception.Production types and all 27 core test-type groups passed for the scheduling repair; production and the affected state test-type group passed again after the final claim-scope refactor. Formatting and
git diff --checkpassed. The final line-cap growth ratchet passes against integrated main: the actor remains at main's 716 counted lines, so raw local lint still reports that inherited absolute 700-line limit. No exception or fake CI environment was used. The compiled-wrapper inventory passed separately (1 selected test; 33.68 s wall).Full-candidate P2 Codex autoreview is clean; the final claim-scope refactor also passed fresh P2 review with no actionable findings. Earlier combined-parent proof passed 106 tests in 13 files; 409.98 s wall, including durable parent-fork siblings and both parent durable-context regressions.
Released-signature source audit against v2026.9.8 found the changed fork/reconcile/usage helpers internal-only, with no changed released SDK/runtime signature. The final report is checked with both head and workflow SHA
aa85ccfa21b8b51d02146b14785b8a0b77f4e1d9, digestdbeef355. Its eight removed and one added entrypoints are inherited from main. Package exports, SDK exports, and runtime export files are unchanged from integrated main. The claim helper is internal-only and absent from the released tag; its caller-facing actor API is unchanged.After integrating P7e, 61 tests in 7 files passed in 412.78 s, covering compute, pending-input/history, side-data, runtime build graph, and imports. After moving compute claim tracking into its existing scope owner, 34 tests in 4 files passed in 348.22 s, including the two-slot compute fixture, real Gateway shutdown, and worker graph/import checks. Claims are still captured synchronously inside the actor FIFO before another turn can publish facts.
Startup-maintenance integration: 74 tests in 7 files passed in 253.71 s with
--maxWorkers=1, including the actor compute suite, readiness, bootstrap, memory projection, publication, reconciliation lifecycle/pool, and Gateway startup maintenance. Core production types, affected state test types, the exact staged-main line-cap ratchet, and a fresh full-candidate P2 review passed.These suites use real worker transport and shared fixtures. The close proof needs the isolated Gateway fixture to establish actual admission closure, publication, and teardown ordering; helper-only mocks cannot prove that boundary. The test runner above is the same runner used by
pnpm test, without reconciling a shared installation.Failure attribution and repairs
Initial CI 37248026115 failed two new durable-cache cases with
SQLite worker runtime capacity reached; fail-fast cancelled sibling jobs. The suite retained two ephemeral actors while those cases required a third, durable carrier. Five original-head runs reproduced both failures with the two-slot broker budget, while five exact merge-base runs passed all 10 original cases. Commit6fd62ff3d847cebeee708627f42e00e6c336a46ascopes the second actor to cross-actor cases, preserving capacity limits and assertions. Its 20-case replay passed in 55.11 s, and CI 37249886348 passed. The original four-file CI shard took 19.42 s before reporting the failures.The first main integration,
ddbac4a25324dfd0971a9dedec5590f8e0bf5082, passed CI 37253125951. Native merge admission then stopped before dispatch because main introduced a new reconciliation conflict. There was no accepted or uncertain merge request. The subsequent real-worker regression held the first native finalization before its planner ACK, queued a smaller rebuild, and rewrote the first transcript. The mechanical merge returned with that projection still dirty. Commit9a109def5e0cf1a57787b47b25e79c2b85e91e74refreshes per-pass sources and passes that regression while preserving main's scheduling policy. Both integrations use merge commits, not rebases.An earlier author-side grouped macOS run exceeded the unchanged compressed-archive cancellation deadline and produced follow-on cleanup failures. The unchanged isolated file passed (5 tests; 68.18 s); no timeout was raised and that replay was not claimed as a fix. Remote attempts produced no proof: Testbox remained queued and the AWS attempt ended during source preparation. No inherited-failure admin exception has been used for this PR.