Skip to content

refactor(sessions): wire incognito history and Memory paths to the actor (P7j, inactive) - #165548

Merged
steipete merged 16 commits into
mainfrom
dbasync/incogp7j
Oct 5, 2026
Merged

steipete merged 16 commits into
mainfrom
dbasync/incogp7j

Conversation

@steipete

@steipete steipete commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The inactive incognito actor needs to serve the remaining history and Memory acquisition paths before the atomic activation can switch production routing without losing the original database owner or current permission checks.

User Impact

P7j remains inactive: ordinary production routing is unchanged. There is no schema, stored-format, retention, durability, expiry, configuration, environment-name, or update change. Native routes remain until the separately reviewed atomic cutover.

Why This Change Was Made

Wire explicit actor sources through history RPC/HTTP/SSE, preview, branch, search, and Memory facades. Reuse existing worker kernels, retain the actor through asynchronous consumers and cleanup, and revalidate snapshots and current authority before disclosure. Memory observers receive original messages; ordinary indexing retains its reduced projection. Corpus grants authorize every selected session.

Session read revisions advance only for sessions named by committed writes, preserving sibling pagination. Equal-key cross-actor forks select permission checks by physical database owner. Search retains the deferred store-wide reconciliation owner from #165217.

Integration with landed #165525 preserves its shared actor binding, admission, and generic context-reader owners. Retired binding callers are migrated, duplicate authorization logic is removed, and the compiled-wrapper inventory follows the surviving runtime imports. Related overlap includes #165151 and incidental #162433; no other PR branch was modified.

The released SDK check against v2026.9.8 found three reachable readers in openclaw/plugin-sdk/memory-core-host-engine-sessions: buildSessionEntry, listSessionTranscriptCorpusEntriesForAgent, and readSessionResetRecallCutoff. Typed SDK facades retain their exact released argument lists, Promise results, and synchronous observer contract while host-only actor sources remain internal. The active memory-session-released-signatures compatibility record, documentation, and type test preserve this supported boundary without deprecation warnings.

Evidence

Current reviewed candidate: 916e6b82014c10c1276d76c941ef5a9741b67627, incorporating main 223f6e441ecb9bb80bbd80d885997a8ecc7270db with merge commits, without rebasing.

Check Result
Final focused integration 178 tests across 14 files passed with --maxWorkers=1; 1395.33s wall, including compiled-worker preparation. Covers history/Memory/lifecycle/pending-history actors, both P7f1 model-context regressions, SessionManager binding/close ownership, Codex SDK/history adapters, runtime build graph, history/get-reply import closure, and the repaired agent.wait fixture.
Production types Passed on the resolved tree; 35.29s wall.
Core test types All 27 canonical shards passed after integration; 377.74s wall using the supported full-stripe mode with concurrency 2.
SDK compatibility Exact released signature assertions compile in the final typecheck. The focused signature test passed; compatibility registry: 12 tests passed, 19.54s wall.
P2 autoreview Clean after SDK preservation and again after P7h1 conflict integration; no accepted/actionable findings.
Compiled-wrapper inventory Final inventory check passed, 54.71s wall; the earlier full 17-test closure suite also passed.
SDK API comparison Completed locally for exact 223f6e441ecb → 916e6b82014c; 2101.38s wall, digest b1bf2115. No added/removed entrypoints or direct export-declaration changes; 168 transitive changes audited with no released-callable incompatibility. The private-local Memory subpath is excluded from this public report and is covered separately by the released-tag comparison and exact signature tests.
Extension types Production and test lanes passed after the normal frozen install restored a missing declared QA Lab workspace link; 10.44s and 44.56s wall. No source repair or dependency change was needed.
Madge Standalone candidate on its older main base reproduced an inherited cycle. Main fix 21901766c534 is included in the CI-tested merge; current baseline 2fec39f57319 independently passes with zero cycles in 211.95s, and exact-head CI check-guards passes.

The two P7f1 patterns were rechecked: a delayed validation reply must not accept a stale snapshot, and an awaited consumer must retain its original owner through settlement. Grant callbacks consume actor-held facts without adding host SQL. The new Memory suite is in the host-owned project; existing and indirect history, SessionManager, close-order, and import-boundary suites were exercised. The real-worker fixtures are required to prove grants, revocation, asynchronous settlement, transport error identity, and rollback; helper-only tests cannot establish those contracts. Exact-head CI run 37313377765 completed with 95 successful jobs and 23 skipped, no failures or cancellations. Its 59 successful Node test execution steps total 14,407 CI seconds; this is the selected Node campaign cost, not a per-file estimate.

Earlier proof remains historical: full build with declarations passed at c80210374913 in 1159.58s; original-head SDK comparison 500c95aaa373 → a1c247199830 completed locally in 1632.54s. The original Linux SDK attempt exited after an unsettled top-level await at native-declaration-subprocess.mts:134 in 114.70s. Both revision renderers were active, so the original failing revision and compiler-exit cause remain unknown. A diagnostic probe reproduced this warning when a compiler exits during an in-flight request; the original exit cause remains unknown. This is not claimed to be proven inherited or repaired by a passing replay.

Failure attribution and main repairs

The initial CI run 37304788542 failed in Madge and the server-plugins.test.ts legacy completed-status fixture. The latter failed identically in five full-file runs on main 5449de6efa13 and five on the first integrated PR tree, each with 66 passing tests and that one failure. Main's normalization cleanup introduced the stale fixture, and main repair 223f6e441ecb is now integrated; the final focused run passes it.

The earlier Madge cycle was introduced by main 1b7d11db6a98 through the deferred-migration type import in the shared-state operation registry. Main fix 21901766c534 extracts the contract into a leaf. Current CI verifies merge ab838af9a15eb1ee9a326eff8b400c66c9fc0b0d, with ordered parents main 2fec39f57319 and candidate 916e6b82014c; its guard job passes. No inherited-failure admin exception is needed.

The original seven unused exports already have main repairs (9a892fb6f903, 2795ad9d0e03, 904a3acddbad), now integrated. The ingress-queue line limit was repaired by 2d3a5c7bbced. The other two original line-limit failures were independently reproduced from exact main 5449de6efa13 blobs: transcript-worker types 703/700 and authorization test 1067/1000. No baselines, assertions, or ignores were relaxed.

ClawSweeper completed candidate-head review at 2026-10-05T13:09:13.549Z with no correctness or security findings. Its request to finish the candidate-bound SDK report is now satisfied above. Its rendered migration checkbox conflicts with its explicit conclusion that no stored-data migration is introduced; Memory hash/timestamp extraction preserves serialized bytes and session revisions are process-local. An update cell is inapplicable to this inactive wiring.

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.
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.
Retain actor ownership through history and Memory consumption, validation, and cleanup. Keep production routing host-owned for atomic P7 activation. Integrate the P7f2 reconciliation dependency and preserve per-session read fences and destination fork authority.
Resolve the wrapper inventory and extracted session-facts contract against P7f2. Retain both actors paths and remove the inherited stale line-cap exception.
Apply the type-only extraction from main commit 439cde7. Keep watcher behavior and state ownership unchanged.
Move the unchanged deletion selection and settlement capture out of the actor transport. Keep the actor within its line cap after prerequisite integration without changing authorization or callback order.
Merge the landing of #165217 while preserving the reviewed history and Memory delta. Reuse the type-only approval descriptor fix from main commit c949e28 to keep the import graph acyclic and its existing SDK export intact.
@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 scripts Repository scripts size: XL labels Oct 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 5, 2026
@clawsweeper

clawsweeper Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 5, 2026, 9:09 AM ET / 13:09 UTC (Revision 3).

ClawSweeper review

What this changes

The branch connects incognito session history and Memory readers to their captured worker actor, preserving authorization and ownership through asynchronous consumption while leaving ordinary production routing unchanged.

Merge readiness

⛔ Blocked before merge - 2 items remain

This remains useful inactive wiring absent from current main. No introduced correctness or security defect was found, and the previous migration blocker is unsupported by the diff.

Priority: P2
Reviewed head: 916e6b82014c10c1276d76c941ef5a9741b67627

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation and boundary coverage are sound, with the candidate-bound SDK comparison still awaiting its recorded result.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository-state context identifies a MEMBER-authored internal prerequisite, so ordinary contributor setup proof is exempt. Inspected real-worker regressions exercise the changed actor readers and revocation boundaries; no unresolved authority case warrants an additional proof gate. Stored-data compatibility is not applicable because hash bytes, schemas, and persisted formats remain unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository-state context identifies a MEMBER-authored internal prerequisite, so ordinary contributor setup proof is exempt. Inspected real-worker regressions exercise the changed actor readers and revocation boundaries; no unresolved authority case warrants an additional proof gate. Stored-data compatibility is not applicable because hash bytes, schemas, and persisted formats remain unchanged.
Evidence reviewed 8 items Pinned introduced delta: Reviewed the merge-base-to-head introduced hunks. The supplied test merge is stale and was not used to infer removal of current-main behavior.
Prior migration concern resolved: The hash and timestamp implementations move unchanged between Memory modules. The worker's session revision map is process-local, advances after committed writes, and clears on close. No schema, serialized-format, retained-data, or migration change is introduced.
Released Memory contract: GitHub source reads verified the v2026.9.8 facade exports the three readers. Their released implementations take two, two, and one arguments respectively, return Promises, and retain a synchronous message observer. The candidate's typed SDK facades preserve those signatures while internal host functions accept actor sources. Local tag inspection failed during object hydration; GitHub contents reads supplied the contract instead.
Findings None None.
Security None None.

How this fits together

Incognito sessions keep transcripts in a process-local database owned by a worker actor. History and Memory readers consume those transcripts to produce chat pages, previews, search results, and indexing inputs.

flowchart TD
  A[History and Memory requests] --> B[Captured session and actor]
  B --> C[Current authority checks]
  C --> D[Worker transcript reads]
  D --> E[History and Memory projection]
  E --> F[Snapshot and authority revalidation]
  F --> G[Authorized results]
Loading

Before merge

  • Complete next step (P2) - Finish and record the SDK API comparison bound to candidate 916e6b8 before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +915, Tests +835, Docs +32, Other +2. Total +1784 across 44 files.

View PR surface stats
Area Files Added Removed Net
Source 34 1111 196 +915
Tests 7 841 6 +835
Docs 2 32 0 +32
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 44 1986 202 +1784

Review metrics

Metric Value Why it matters
Production versus test growth production net +915; tests and support net +834 The body justifies production growth as the remaining inactive history and Memory composition, with boundary regression coverage.
Released reader contracts 3 signatures preserved Typed SDK facades keep internal actor-source arguments outside the released plugin call contracts.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugins/compat/session-persistence-records.ts, serialized state: packages/memory-host-sdk/src/host/session-entry-projection.ts, serialized state: packages/memory-host-sdk/src/host/session-files.ts, unknown-data-model-change: packages/memory-host-sdk/src/host/session-entry-projection.ts, unknown-data-model-change: packages/memory-host-sdk/src/host/session-files.ts, vector/embedding metadata: packages/memory-host-sdk/src/host/session-entry-projection.ts, and 4 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep this composition inactive until the separate atomic cutover, preserving released SDK signatures and current authority checks throughout acquisition, consumption, and cleanup.

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

Not applicable: this is inactive ownership wiring rather than a reported current-main failure; inspected boundary regressions cover the changed contracts, but no tests were executed during review.

Is this the best way to solve the issue?

Yes: explicit actor sources reuse existing worker kernels and shared admission owners while typed facades preserve the released plugin contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded internal ownership prerequisite without ordinary production activation or an urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository-state context identifies a MEMBER-authored internal prerequisite, so ordinary contributor setup proof is exempt. Inspected real-worker regressions exercise the changed actor readers and revocation boundaries; no unresolved authority case warrants an additional proof gate. Stored-data compatibility is not applicable because hash bytes, schemas, and persisted formats remain unchanged.

Evidence

What I checked:

  • Pinned introduced delta: Reviewed the merge-base-to-head introduced hunks. The supplied test merge is stale and was not used to infer removal of current-main behavior. (916e6b82014c)
  • Prior migration concern resolved: The hash and timestamp implementations move unchanged between Memory modules. The worker's session revision map is process-local, advances after committed writes, and clears on close. No schema, serialized-format, retained-data, or migration change is introduced. (src/config/sessions/session-incognito.worker.ts:83, 916e6b82014c)
  • Released Memory contract: GitHub source reads verified the v2026.9.8 facade exports the three readers. Their released implementations take two, two, and one arguments respectively, return Promises, and retain a synchronous message observer. The candidate's typed SDK facades preserve those signatures while internal host functions accept actor sources. Local tag inspection failed during object hydration; GitHub contents reads supplied the contract instead. (src/plugin-sdk/memory-core-host-engine-sessions.ts:43, fc23bc864e45)
  • Final disclosure and corpus authority: Corpus acquisition captures every selected session claim, authorizes each claim, captures snapshots inside the actor read callback, and revalidates before returning metadata. Memory callbacks check authority and snapshot freshness before and after invocation; asynchronous model-context consumers receive final validation and retain their owner through settlement. (src/config/sessions/session-incognito-memory-corpus.ts:29, 916e6b82014c)
  • Boundary regression coverage: Inspected real-worker cases covering callback revocation, intervening transcript writes, retained borrow settlement, sibling corpus denial, foreign session bindings, and asynchronous consumer revocation. Cross-actor fork cases deny destination transaction or commit grants and inspect the destination transcript afterward. The captured body reports 178 passing integration tests; this read-only review did not execute them. (src/state/openclaw-agent-execution-incognito.memory.test.ts:142, 916e6b82014c)
  • Still necessary on current main: Fetched main's compute reader lacks the new Memory corpus acquisition and original-message observer wiring. The merged related PRs provide prerequisites rather than a replacement for this remaining composition. (src/config/sessions/session-incognito-compute-read.ts:68, d9335e959f48)

Likely related people:

  • Peter Steinberger: Raw commit b0d6eea adds src/config/sessions/session-incognito-admission.ts:32 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b0d6eea2fe08; files: src/config/sessions/session-incognito-admission.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the completed SDK API comparison for the reviewed candidate and resolve any newly reported contract changes.

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 (2 earlier review cycles)
  • reviewed 2026-10-05T11:48:38.410Z sha a1c2471 :: blocked before merge. :: none
  • reviewed 2026-10-05T11:59:37.714Z sha a1c2471 :: blocked before merge. :: none

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

Keep the released Memory SDK reader arguments and synchronous observer
contract while host internals accept inactive actor sources. Record the
supported compatibility boundary and add exact signature type coverage.

Merge main without rebasing to incorporate canonical unused-export and
source-ratchet repairs. P2 review is clean. Production types pass; focused
runtime and remaining type checks continue. The inherited main Madge cycle
and agent.wait expectation failure remain independently attributed.
Merge main without rebasing and retain the shared incognito binding,
admission and context-reader owners from P7h1. Preserve Memory observer
and corpus behavior, migrate the removed binding helper's callers, and
remove duplicate authorization logic and obsolete wrapper inventory.

Main also supplies the agent.wait normalized-result fixture repair.
P2 review is clean and production types and Gateway boundary checks pass.
@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 6881d25 into main Oct 5, 2026
192 checks passed
@steipete
steipete deleted the dbasync/incogp7j branch October 5, 2026 14:06
@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
…tor (P7j, inactive) (openclaw#165548)

* 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

* fix(skills): reuse watcher type leaf to clear inherited cycle

Apply the type-only extraction from main commit e79415d. Keep watcher behavior and state ownership unchanged.

* refactor(sessions): keep lifecycle settlement with its contract

Move the unchanged deletion selection and settlement capture out of the actor transport. Keep the actor within its line cap after prerequisite integration without changing authorization or callback order.
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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