Skip to content

refactor(sessions): compose compute and fork paths on the incognito actor (P7f2, inactive) - #165217

Merged
steipete merged 8 commits into
mainfrom
dbasync/incogp7f2
Oct 5, 2026
Merged

steipete merged 8 commits into
mainfrom
dbasync/incogp7f2

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

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 through ddf95b6c52db452426f56a62d46962284b2d5f31 is 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 (digest dbeef355); 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 main 8edaa95d9589ccae0284c47faba659adf62b9fa9, 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 --check passed. 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, digest dbeef355. 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. Commit 6fd62ff3d847cebeee708627f42e00e6c336a46a scopes 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. Commit 9a109def5e0cf1a57787b47b25e79c2b85e91e74 refreshes 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.

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

clawsweeper Bot commented Oct 5, 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 size: XL labels Oct 5, 2026
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 1:43 AM ET / 05:43 UTC (Revision 12).

ClawSweeper review

What this changes

The 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
Reviewed head: aa85ccfa21b8b51d02146b14785b8a0b77f4e1d9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent internal composition with strong boundary evidence and no actionable correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Reported real-worker runs exercise actor reconciliation, usage consumers, and fork facades, including yield recovery and authority revocation; the real Gateway-close case observes publication and exact cleanup before teardown. Source inspection supports those scenarios, and exact-head CI is successful. No stored-data contract changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Reported real-worker runs exercise actor reconciliation, usage consumers, and fork facades, including yield recovery and authority revocation; the real Gateway-close case observes publication and exact cleanup before teardown. Source inspection supports those scenarios, and exact-head CI is successful. No stored-data contract changes require migration proof.
Evidence reviewed 8 items Pinned introduced change: Reviewed the merge-base-to-head hunks using the supplied introduction identities. The stale test merge was not used to infer removal of newer main behavior.
Still necessary on current main: Fetched main still has single-session projection composition; the complete store, deferred reconciliation, usage-consumer, and fork composition remains distinct work. The merged history prerequisite #165134 explicitly separated this compute stage.
Intentional inactive prerequisite: The documentation explicitly retains production native routing until atomic activation removes the remaining host extraction paths. This is a staged internal cutover, with no introduced schema, stored-format, retention, durability, configuration, or update contract.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Source +895, Tests +842, Docs +21. Total +1758 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 19 1309 414 +895
Tests 4 1041 199 +842
Docs 1 26 5 +21
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 24 2376 618 +1758

Review metrics

Metric Value Why it matters
Production versus test growth Production net +895 lines; tests net +842 lines The PR explains production growth through retained actor lifetime, store composition, authority checks, and exact cleanup; added tests exercise worker and shutdown boundaries.

Technical review

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a useful internal session-worker prerequisite with production activation explicitly deferred.
  • 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): Reported real-worker runs exercise actor reconciliation, usage consumers, and fork facades, including yield recovery and authority revocation; the real Gateway-close case observes publication and exact cleanup before teardown. Source inspection supports those scenarios, and exact-head CI is successful. No stored-data contract changes require migration proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported real-worker runs exercise actor reconciliation, usage consumers, and fork facades, including yield recovery and authority revocation; the real Gateway-close case observes publication and exact cleanup before teardown. Source inspection supports those scenarios, and exact-head CI is successful. No stored-data contract changes require migration proof.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head hunks using the supplied introduction identities. The stale test merge was not used to infer removal of newer main behavior. (aa85ccfa21b8)
  • Still necessary on current main: Fetched main still has single-session projection composition; the complete store, deferred reconciliation, usage-consumer, and fork composition remains distinct work. The merged history prerequisite refactor(sessions): compose history and SessionManager reads on the incognito actor (P7f1, inactive) #165134 explicitly separated this compute stage. (src/config/sessions/session-incognito-projection.ts:11, 439cde79c612)
  • Intentional inactive prerequisite: The documentation explicitly retains production native routing until atomic activation removes the remaining host extraction paths. This is a staged internal cutover, with no introduced schema, stored-format, retention, durability, configuration, or update contract. Public docs: docs/reference/database-schemas/worker-access.md. (docs/reference/database-schemas/worker-access.md:525, aa85ccfa21b8)
  • Authority and fork ownership: Cross-actor destination operations reauthorize the retained source claim at transaction and commit admission. Forks reuse the existing transaction kernels, and actor lifetimes surround the composition without retaining either FIFO turn across the other actor's work. (src/config/sessions/session-parent-fork.ts:478, aa85ccfa21b8)
  • Production-boundary proof: The captured PR body reports passing real-worker compute and lifecycle runs, including scheduler-yield recovery, foreign actor refusal, post-pricing permission/generation revocation, and cross-agent fork revocation. The inspected Gateway-close case uses the real server and actor transport, observing accepted projection/cache publication, refresh-lock cleanup, refusal of fresh work, and eventual actor teardown; its reported runtime is 14.255 seconds. These observations cover this inactive internal composition rather than claiming production activation. (src/gateway/server-close.incognito-compute.test.ts:20, aa85ccfa21b8)
  • Exact-head validation and review continuity: GitHub confirms CI run 37266960600 completed successfully on the pinned head, attempt 1. The supplied latest completed review examined this same head and retained no findings or rank-up moves; the earlier fixture-capacity repair remains present. (aa85ccfa21b8)

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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-05T01:36:35.268Z sha 6fd62ff :: blocked before merge. :: none
  • reviewed 2026-10-05T01:59:55.134Z sha ddbac4a :: needs changes before merge. :: none
  • reviewed 2026-10-05T02:18:26.437Z sha ddbac4a :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T03:30:16.475Z sha 9a109de :: blocked before merge. :: none
  • reviewed 2026-10-05T03:48:56.882Z sha 9a109de :: blocked before merge. :: none
  • reviewed 2026-10-05T04:45:28.814Z sha 0cf9af1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T05:03:22.581Z sha 0cf9af1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-05T05:20:41.986Z sha aa85ccf :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 5, 2026
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

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

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 5, 2026
Base automatically changed from dbasync/incogp7f to main October 5, 2026 01:30
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Oct 5, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Oct 5, 2026
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

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

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 5, 2026
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.
@openclaw-barnacle openclaw-barnacle Bot closed this Oct 5, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 5, 2026
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Oct 5, 2026
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 5810483 into main Oct 5, 2026
138 of 139 checks passed
@steipete
steipete deleted the dbasync/incogp7f2 branch October 5, 2026 05:52
@steipete

steipete commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 6, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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