Repository navigation
feat(state): incognito actor history routing (P5a, inactive) - #163987
Conversation
Reuse worker history selectors on the retained incognito actor with FIFO, live disclosure authorization, and snapshot hydration. Keep production host-owned until P7; P5b compute, Memory, and Codex routing is stacked next.
|
🦞👀 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 2, 2026, 11:44 PM ET / October 3, 2026, 03:44 UTC (Revision 3). ClawSweeper reviewWhat this changesAdds inactive worker-owned incognito history reads that reuse the session’s memory database, share existing history selectors, and recheck authorization before returning content. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, inactive step in the accepted incognito worker migration. The pinned diff introduces no concrete blocking defect, and the supplied production-worker evidence covers disclosure denial and revocation. Priority: P2 Review scores
Verification
How this fits togetherIncognito sessions hold conversation data in memory. This adapter sends history requests through the retained database worker and formats its results for Gateway RPC and HTTP readers. flowchart TD
A[History request] --> B[Captured session and caller]
B --> C[Actor FIFO queue]
C --> D[Retained memory database]
D --> E[Shared history selectors]
E --> F[Display formatting]
F --> G{Current disclosure authority}
G --> H[Return history or refuse]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +781, Tests +426, Docs +20. Total +1227 across 26 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep history acquisition with the retained actor and shared selectors, preserving the accepted inactive rollout until the complete production cutover. Do we have a high-confidence way to reproduce the issue? Not applicable to a current user-facing bug: this adds an inactive migration adapter. Its supplied harness directly exercises the production actor and history boundaries. Is this the best way to solve the issue? Yes: reusing the retained connection, existing FIFO, and shared selectors preserves one storage owner while keeping authorization current at disclosure. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4a0be71e57ab. 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
History |
Place the incognito history adapter with the shared snapshot composition owner and remove its production-unreachable standalone module. Preserve lazy RPC kernel loading and the existing authorization and FIFO contracts. Fixes the check-dependencies unused-file failure without an ignore or activation change.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…w#163987) * feat(state): incognito actor history routing (P5a, inactive) Reuse worker history selectors on the retained incognito actor with FIFO, live disclosure authorization, and snapshot hydration. Keep production host-owned until P7; P5b compute, Memory, and Codex routing is stacked next. * fix(state): keep inactive history composition in its owner Place the incognito history adapter with the shared snapshot composition owner and remove its production-unreachable standalone module. Preserve lazy RPC kernel loading and the existing authorization and FIFO contracts. Fixes the check-dependencies unused-file failure without an ignore or activation change.
What Problem This Solves
The inactive incognito actor needs history reads that observe its committed writes without reopening its memory database. Reads also need current source authorization after queue waits and before disclosure.
Solution
Add actor-bound history pages and deltas, selected reads, title/preview, branches, context, search/matching, receipts, and hydration. Reuse the durable reader selectors and existing RPC/HTTP composition kernels with prepared display facts. Reads share the actor writer FIFO, use its read-only operation scope, and recheck caller and session authority before returning content.
Separate the transport types from runtime readers to keep the import graph acyclic. Preserve the captured state environment through title reads. Existing commit receipts and lifecycle settlement remain with their current owner.
Impact
P5a is inactive: production incognito remains host-owned until P7. No schema, durability, retention, permission, configuration, or update behavior changes. Full hydration keeps the existing incognito full-materialization behavior while acquiring one actor snapshot; it does not adopt durable hydration's lower-memory streaming contract.
P5b is stacked next for usage/projection orchestration, compute cleanup after revocation, Memory entry/reset-recall, and public-SDK Codex history.
Evidence
06ac4a4672ea5a9ac2bcef9c01e3e1121011ed24.pnpm test src/state/openclaw-agent-execution-incognito.history.test.ts src/state/openclaw-agent-execution-incognito.lifecycle.test.ts src/state/openclaw-agent-execution-incognito.sessions.test.ts --maxWorkers=1, 161.94s wall including 66.45s compiled-worker preparation. Vitest phase: 71.26s on the loaded local host; no separate CI duration measurement.OPENCLAW_*names.sessions.readregression fail (122.83s wall); the candidate guard was restored byte-for-byte.node scripts/check-changed.mjs --base 06ac4a4672ea5a9ac2bcef9c01e3e1121011ed24(1,228.11s wall).Landing contract checks
v2026.9.8(rechecked after its publication during landing), includingsrc/plugin-sdk/**,src/plugins/runtime/**, and documented SDK subpaths. No released function changes sync/async behavior, callback shape, or export availability. Moved types retain their original re-exports and structural shapes. The optional retained-database argument onreadSessionPreviewItemsReadOnlyis an internal worker interface; the released SDK andapi.runtime.*do not expose it. No deprecation adapter is needed for this inactive phase.OPENCLAW_*names.Landing correction and CI attribution
3e4c0e4de9780fixes the PR-causedcheck-dependenciesunused-file failure by placing the inactive actor reader in the existingsession-history-snapshot.tscomposition owner and deleting the standalone module. RPC kernels stay lazy; no activation or ignore is added. The P5b import location is nowsrc/gateway/session-history-snapshot.ts.The corrected candidate passed the actor-history and durable-pagination suites (18 tests, 122.71s wall including compiled-worker preparation), both
pnpm deadcode:fullpasses, scoped lint, and the import-cycle check (0 runtime cycles). Fresh full-candidate Codex autoreview through P2 is scoped-clean; its source evidence includes the existing incognito read-only helper that reuses the actor's open memory connection.The original CI run's separate subagent settled-batch failure is inherited from main:
fdbf48d1383bfaddedretireSubagentGatewayBinding, while the restart fixture omitschatAbortControllers. Scheduled main run 37091047803 / job 111111464003 reports the exact same test and stack (subagent-parent-recovery.restart-integration.test.ts:349,subagent-registry-execution-cleanup.ts:55). Those files, the fixture, and lifecycle caller are unchanged by this PR and have identical blobs between that main run and the original PR test merge. Five single-worker exact-file runs on the PR candidate and five on merge base06ac4a4672ea5a9ac2bcef9c01e3e1121011ed24each passed 14/14. This records attribution, not a claim that inherited CI is green. Exact-head CI run 37093467566 completed with 97 successful jobs, 20 skipped jobs, the same inherited fixture failure in job 111118697616, and its downstream aggregate failure in job 111120158561.check-dependenciesis now green. The tested merge is5023769cf5c1b10ff6e29dafc320cf109ef6fb96(main81987cd91a5af220833778db5e440993e22db936plus head3e4c0e4de97809a28ae65ca83611d6d4ceb98763). There were no cancelled CI jobs or reruns. Landing uses the explicitly authorized native pre-existing-failure exception, retaining failed CI and all required security/review checks.