Repository navigation
refactor(sessions): add actor read commands for hydration and pending-input history (P7c, inactive) - #164819
Conversation
Preserve shared ACP metadata persistence and sequencing while preparing actor entry commands, transaction-local controller guards, board snapshots, and shared idle-pin lifetime. Keep production host-owned until P7 and document the remaining synchronous SDK and caller cutover requirements. Validation: 44 tests passed with one platform skip on isolated Linux; four pre-fix negative controls reproduced missing pins, grant reentrancy, and revoked-policy persistence. Changed-file checks, database-worker ratchet, zero-cycle checks, and Codex review through P2 passed. T1 remains 915; no new environment names.
Merge current main to consume the Doctor-owned ACP migration contract. Keep P6 inactive, remove retired runtime legacy-key and cleanup calls, consolidate ACP composition in its existing mutation owner, and complete the compiled wrapper dependency inventory. Preserve entry-before-metadata ordering and update the focused sequence proof.
Merge main to include its suppression-inventory fix. Expose ACP operations through the inactive actor borrow, retaining the full lazy-load and operation promise before any await. Extend the nested-grant regression to both ACP methods; the unguarded binding fails this control. Document intentional model-mock isolation without expanding its baseline. Production incognito routing remains native until P7.
Keep production incognito routing inactive until P7d. Add typed actor navigation reads and pending-input reconciliation with live custody and exact native receipt recovery; preserve durable behavior and native arms for the atomic activation.
Merge main CI ratchet fixes and move shared ACP input/result shapes into a leaf contract. Remove static implementation-type cycles while preserving lazy runtime loading inside actor custody. Production incognito routing remains inactive and released Plugin SDK call signatures remain compatible.
Keep hydration navigation bound to the captured target and carry the confirmed result across read grants. Extract shared ACP access signatures into a leaf contract to remove the inherited P6 import cycle without changing runtime behavior. Include the leaf in compiled-wrapper dependencies.
Adopt P6s canonical incognito ACP type contract and remove the duplicate local extraction. Hydration and pending-input behavior remain the reviewed P7c implementation.
Expose hydration preparation through the existing inactive compute reader and pending-input list/exact reads through the existing history composition. Retain lazy loading, current disclosure authority, and accepted persistence settlement. Drive focused proofs through these production composition entry points.
Keep the captured pending-input payload immutable without reassigning the caller parameter, and join test backend cleanup before surfacing a fixture failure.
Preserve the reviewed P7c implementation and keep the P6 activation checklist with its original section. Place the inactive P7c documentation after that checklist.
|
🦞👀 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 4, 2026, 3:56 AM ET / 07:56 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds inactive worker-backed incognito transcript navigation and pending-input history readers, preserving live custody checks and recovering committed interruption results after a lost reply. Merge readiness✅ Ready for maintainer review This remains useful preparation for the accepted incognito worker migration. Current main lacks the added compositions, and the reviewed delta introduces no concrete blocking correctness or security finding. Priority: P2 Review scores
Verification
How this fits togetherIncognito sessions keep conversation data in a process-lifetime SQLite database. These prepared readers send captured session requests to its worker owner and return authorized transcript or pending-input results to the Gateway. flowchart TD
A[Captured session request] --> B[Inactive reader composition]
B --> C[Actor FIFO]
C --> D[Existing SQLite kernels]
D --> E[Live authority and custody checks]
E --> F[Committed receipt or read snapshot]
F --> G[Authorized Gateway result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +372, Tests +643, Docs +23. Total +1038 across 16 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep these prepared reads with the existing actor owner and reserve production activation and native-path removal for the documented atomic cutover. Do we have a high-confidence way to reproduce the issue? Not applicable: this is inactive migration preparation rather than a reported current-runtime bug; its focused authority and settlement scenarios are defined in the inspected harnesses. Is this the best way to solve the issue? Yes: extending the existing actor FIFO and reusing canonical hydration and interruption kernels fits the accepted staged migration without adding another storage owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c071d238483a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…-input history (P7c, inactive) (openclaw#164819) * feat(state): prepare incognito ACP ownership (P6, inactive) Preserve shared ACP metadata persistence and sequencing while preparing actor entry commands, transaction-local controller guards, board snapshots, and shared idle-pin lifetime. Keep production host-owned until P7 and document the remaining synchronous SDK and caller cutover requirements. Validation: 44 tests passed with one platform skip on isolated Linux; four pre-fix negative controls reproduced missing pins, grant reentrancy, and revoked-policy persistence. Changed-file checks, database-worker ratchet, zero-cycle checks, and Codex review through P2 passed. T1 remains 915; no new environment names. * refactor(sessions): prepare actor hydration and pending-input history Keep production incognito routing inactive until P7d. Add typed actor navigation reads and pending-input reconciliation with live custody and exact native receipt recovery; preserve durable behavior and native arms for the atomic activation. * fix(sessions): preserve actor targets and separate ACP contracts Keep hydration navigation bound to the captured target and carry the confirmed result across read grants. Extract shared ACP access signatures into a leaf contract to remove the inherited P6 import cycle without changing runtime behavior. Include the leaf in compiled-wrapper dependencies. * refactor(sessions): compose inactive actor history and hydration readers Expose hydration preparation through the existing inactive compute reader and pending-input list/exact reads through the existing history composition. Retain lazy loading, current disclosure authority, and accepted persistence settlement. Drive focused proofs through these production composition entry points. * fix(sessions): retain cloned inputs and await fixture cleanup Keep the captured pending-input payload immutable without reassigning the caller parameter, and join test backend cleanup before surfacing a fixture failure.
What Problem This Solves
The inactive incognito actor path lacked four hydration navigation reads and the pending-input history/interruption composition needed before atomic activation. Production incognito still belongs to the host.
Why This Change Was Made
Add typed actor reads for current-turn entries, maintenance facts, recent active events, latest active messages, and pending-input pages. Bind hydration to its captured actor/session generation; extra runtime request fields cannot override that target. The existing inactive compute reader exposes hydration preparation, and the inactive history composition exposes pending-input list and exact reads with retained loading and disclosure checks.
Reuse the existing bounded pending-history and interruption kernels on the actor's FIFO. Recheck live host custody at transaction and commit admission, recover the exact interrupted IDs from the native commit receipt when the ordinary reply is lost, and retain the complete composition through settlement without holding a FIFO turn across another actor request.
Based on main after #164727 merged. Its canonical ACP leaf contract is reused; the duplicate local extraction was removed. The main integration preserves every P7c production file byte-for-byte. Related overlap: #164747 (history-reader work), sibling P7a/P7b preparation, and #162433 (the broader ownership draft). This branch does not implement those lanes or activate their routes.
User Impact
Inactive preparation only. Native production arms remain for P7d's atomic switch and deletion. Durable flows, schemas, storage, retention, permissions, and update behavior are unchanged. No new
OPENCLAW_*names, dependency, worker service, or persistent cache.P7c-only production delta against final main: +380 / −8 / net +372, across ten production modules. Four test/support files, test routing, and the worker-access reference complete the 16-file diff. T1: 907 → 907 against final main (
3e9d7d38c2aa23). The initial branch measured 914 → 914; the seven-site reduction came from later upstream integration. No P7c main-thread reduction is claimed before activation.Pending-input staging/source/withdrawal and the other P7 activation prerequisites remain separate work. This PR must not be used as the activation switch.
Evidence
All focused commands used
--maxWorkers=1locally. Tests use synthetic isolated state and the real actor/broker; only pending-row fixture boot data is seeded by a test backend.The final composition-entry-point proof reran all 20 hydration, pending-history, and real-close tests successfully in 449.37 s command wall. The fixture-cleanup follow-up reran all six pending-history/close tests successfully in 418.14 s.
The new pending-history file took 208.73 s Vitest wall (49.5 s test time), and the real-close file took 149.24 s (35.4 s test time) on this loaded host. They reuse suite-level actors and do not boot a Gateway. Real native grants, commit receipts, and the actual close order are the contracts that require these integration boundaries. The two hydration additions took 61 ms of test time in the final run. CI seconds are not yet available.
The captured-target regression failed before the explicit-field fix with an actor generation mismatch, then passed with all 14 history tests. Initial fixture failures were corrected by selecting the existing host-owned database-worker test pool and using the canonical transaction owner for seed writes. The inherited Git baseline-buffer and mock-isolation gate failures were resolved through main/P6 integration, without weakening guards.
3e9d7d38c2aa23c7aed4655e19e4c7dbad952f50; T1 remains unchanged.6663bac175fcba157a8064646b0e2ef2add7396e.node scripts/check-changed.mjswas run repeatedly and exposed issues that were repaired. All 27 core-test type groups passed on the reviewed candidate; final core and affected test-graph checks were rerun after the routing/cleanup follow-up. Scoped lint of every changed core file and script lint passed. Landing recheck: main already fixed the chat-metadata max-lines overage in perf(gateway): admit agent databases when the listener binds #164670 (3f6c1d3a). Direct oxlint of both current-main-identical files reports only the unchangedsessions-patch-engine.tsoverage (719 counted lines; limit 700). Repository policy makes untouched-file limits advisory in scoped changed checks and size limits advisory in GitHub Actions. Scheduled main CI passed check-lint and every core lint shard. The original broad local failure remains recorded as historical evidence; no guard, baseline, or assertion was weakened. Exact-head CI remains the landing gate.6663bac175fcba→a72e1450bd1363, including the routing composition): passed in 1322.19 s; 127 reachable declaration-closure changes, no entry-point or direct export declaration changes. Subsequent cleanup and main integration leave P7c declarations unchanged. These actor types are absent from shippedv2026.9.8; no released service method was changed.qaRuntimebuild: passed, including bundled plugin assets, standalone worker outputs, CLI bootstrap import guard, runtime postbuild, and stamps; 416.19 s wall including artifact-lock wait.No live Gateway was modified and no remote lease was used.
The final core typecheck and the state/logging and Gateway-server test type graphs passed. All remaining schema, database-first storage, media, runtime-sidecar, runtime-import-cycle, webhook-auth and pairing guards passed.