Repository navigation
fix(cron): run keeps owner-private memory after its requester loses owner status - #198697
hannesrudolph merged 2 commits into
Conversation
A fired condition can wait a long time for a run slot after its occurrence was admitted. Each run minted the owner bit captured at admission, so a requester who lost owner status during the wait still got an owner context, and with it owner-private memory. Each run now reads the bit again from the requester's existing owner check against the live config. Refs openclaw#196859
|
🦞👀 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. |
|
Codex review: blocked before merge. What this changesRecheck requester ownership when a scheduled run mints its execution context after waiting for capacity. Example: Discord requester 100000000000000001 loses owner status while its automation waits behind eight occupied cron slots.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR fixes a concrete authorization bug still present on current main, with a focused change and no actionable code findings. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherCron admission prepares an occurrence from the stored job and requester identity; each payload mints execution facts that both embedded and CLI memory resolvers consume. flowchart LR
A[Stored automation] --> B[Occurrence admission]
B --> C[Wait for run capacity]
C --> D[Mint execution context]
E[Current requester authority] --> D
D --> F[Embedded and CLI resolvers]
F --> G[Host minted memory audience]
Technical reviewBest possible solution: Use the existing requester-authority predicate at run minting while preserving intentional legacy and trusted-policy behavior. Do we have a high-confidence way to reproduce the issue? The current-main minting path demonstrably reuses admission-time ownership across the reported wait; the contributor reports both added regressions failing without the fix and passing with it, but this review executed no target code. Is this the best way to solve the issue? This is the smallest complete repair: refresh the authority fact at the existing minting owner, allowing both memory runtimes to consume the corrected decision without new state or parallel policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f22598f7828. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests +60. Total +63 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 14, 2026, 2:19 AM ET / 07:19 UTC (Revision 2). |
|
Live Gateway proof passed on unchanged head One disposable macOS 26.6.2 VM, Node 24.21.0. The embedded runtime used the repo's The synthetic Discord requester was
Condensed, redacted terminal facts from the final scenario on 2026-11-14 (UTC; Both payload audiences matched the parent's actual session key and session ID, and neither was |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…wner status (openclaw#198697) * fix(cron): recheck the requester's owner status when a run starts A fired condition can wait a long time for a run slot after its occurrence was admitted. Each run minted the owner bit captured at admission, so a requester who lost owner status during the wait still got an owner context, and with it owner-private memory. Each run now reads the bit again from the requester's existing owner check against the live config. Refs openclaw#196859 * test(cron): cover owner removal through a published config on both memory runtimes
Clear settled rejected CLI cleanup, preserve detached paired-node Gateway context, cancel MCP work before socket drain, and refresh queued requester ownership before granting owner-private memory. Selected ledger fixes: #198224, #145741, #197119, #198697. The owner-check predicate prerequisite is a narrow adaptation, not the unrelated failure-repair feature. (cherry picked from commit 4f8df80) (cherry picked from commit dbedd7b) (cherry picked from commit 480389e) (cherry picked from commit 7a4e9f1) (cherry picked from commit 8100c60) Proof: four affected files and targeted real HTTP cancellation regression pass on the frozen fix. Isolated c2 baseline fails detached context, cleanup retry, both queued-owner revocation cases and MCP shutdown cancellation. The full MCP suite has a preexisting slow-body fixture hang on both Node and Bun; this remains open and is not represented as a passing full suite. Fresh independent review found no actionable P0/P1 findings. FRV pending. Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: obviyus <[email protected]> Co-authored-by: Edward Abrams <[email protected]> Co-authored-by: Wynne668 <[email protected]> Co-authored-by: Daniel <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Closes #198695
What Problem This Solves
An automation run can receive owner-private memory after its requester loses owner status while a fired condition waits for a free cron slot.
User Impact
A run that starts after its requester is removed from the owner list receives only its parent conversation's memory audience. Runs whose requester remains an owner retain owner-private memory.
Why This Change Was Made
Admission can happen long before payload execution. Each run rechecks requester ownership against the live runtime config when minting its execution context. Existing owner-only tool checks and intentional legacy/trusted-policy behavior are preserved.
Evidence
Live Gateway proof on
99181aaexercised both runtimes in one disposable VM with the repo's scripted mock provider and a CLI stub:owner-privateand completed successfully.conversationfor the exact parent session key and session ID. The CLI stub recorded that same host-minted audience and run ID. Both payloads completed successfully.A temporary observer recorded the runtime's audience; the CLI adapter passed that observed value to its stub. The Gateway scheduler, config watcher, SQLite session infrastructure, and both memory resolvers were real. The requester provenance and model transports were synthetic. No production code was changed for the proof, and the admission/resolver source hashes matched the PR head.
Two focused regressions in
src/cron/execution-context-memory-audience.test.tsrevoke a channel requester's ownership through a published config, or revoke a profile requester's access, between admission and minting. Recorded regression results: both cases fail without the fix on both runtime resolvers; the fixed test file passes all 9 tests.Validation Limits
The live run verifies audience assignment with synthetic model transports. It did not call a hosted model, send real Discord traffic, or read private-memory contents. The focused regression file and full suite were not rerun during the VM proof task.