Repository navigation
fix: preserve automation management after subagent waits - #147499
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed September 13, 2026, 8:02 PM ET / September 14, 2026, 00:02 UTC (Revision 4). ClawSweeper reviewWhat this changesPreserves administrators’ automation management when their agent resumes after waiting for subagents, with lifecycle-bound grants, regression coverage, and documentation. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. No actionable introduced defects were found, and the previously requested authority proof is satisfied by the reported persisted-mutation results and inspected production-path fixture. Priority: P2 Review scores
Verification
How this fits togetherThe subagent registry resumes a waiting parent after its children finish. Gateway admission gives that continuation fresh automation-management grants, which the automation service revalidates before changing stored jobs. flowchart TD
A[Authenticated administrator turn] --> B[Explicit subagent wait]
B --> C[Committed child batch]
C --> D[Requester continuation admission]
D --> E[Fresh management grant]
E --> F{Session and run still authorized?}
F -->|Yes| G[Update stored automation]
F -->|No| H[Reject without mutation]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +526, Tests +1120, Docs +12. Total +1658 across 20 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep management authority attached to the verified task handoff, issue fresh successor grants, and enforce revocation at the existing automation mutation boundary. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main rejects the synthetic continuation's management authority after the original run closes, and the contributor reports a failing old-admission replay through the persisted-update fixture. No tests were executed in this read-only review. Is this the best way to solve the issue? Yes. The patch extends the existing requester settlement and grant owners, preserves management-only scope, and avoids reviving expired grants or adding a competing permission mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0176c61961da. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review Added the requested final-effect proof in |
|
🦞👀 Re-review progress:
|
80f0dc3 to
2f1a88f
Compare
|
@clawsweeper re-review Rebased the final-effect proof onto current main to resolve the adjacent cleanup/import conflict with #147480. Head: |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review The reviewed automation implementation and persisted-mutation proof are unchanged. The only additional change fixes the unrelated Reef test flake found by CI: Date-only fake time plus one millisecond per fixture insertion makes the existing exact-order assertions deterministic. A frozen-clock replay failed before the repair; all 18 trust-store tests pass afterward, and an independent P2 review is clean. Production and test typechecking pass. The previous review’s authority-proof blocker remains resolved. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Continue authenticated Control UI automation management after an explicit subagent yield by binding its entitlement to the committed requester batch. Admit fresh management-only grants for the successor and revalidate the live session, batch, and run owner at use time. Preserve retryable handoffs and canonical child replacements. Revoke pending authority on cancellation, reset, new direct user admission, and committed settlement without reviving the original run's grants. Cover the original trusted-automation visibility regression, repeated yields, callback binding, retry, revocation, and cleanup. Validation: focused tests, changed-file checks, full build, and independent P2 review.
dcabc6c to
a57d239
Compare
|
Merged via squash.
|
…7499) * fix(agents): retain automation authority across requester yield Continue authenticated Control UI automation management after an explicit subagent yield by binding its entitlement to the committed requester batch. Admit fresh management-only grants for the successor and revalidate the live session, batch, and run owner at use time. Preserve retryable handoffs and canonical child replacements. Revoke pending authority on cancellation, reset, new direct user admission, and committed settlement without reviving the original run's grants. Cover the original trusted-automation visibility regression, repeated yields, callback binding, retry, revocation, and cleanup. Validation: focused tests, changed-file checks, full build, and independent P2 review. * test(agents): prove resumed automation writes at the service boundary
What Problem This Solves
Fixes automation management failing with “Automation not found” after an authenticated Control UI administrator waits for subagents with
sessions_yield.User Impact
The parent can continue managing existing automations after its children finish, without asking the administrator to send another message. Cancellation, session reset/archive, a new direct user turn, and Gateway restart still revoke the handoff. No configuration or data migration is required.
Why This Change Was Made
Yield closes the original run, while child settlement starts a synthetic continuation. The registry now transfers the verified parent entitlement through the committed child batch, and Gateway admission issues fresh management-only grants for the successor. The committed batch owns the pending handoff; after admission, the fresh run scope owns the grants until it closes. Retiring a delivered batch cannot revoke a still-running parent. Retryable delivery failures retain an unconsumed handoff.
This covers explicit requester yields, including repeated yields and canonical child replacements. It preserves private completion routing and does not promote ordinary inter-session messages or restore privileges across Gateway restarts.
Evidence
The final-effect integration fixture uses synthetic authenticated connection/model inputs and real SQLite session/subagent persistence, requester handoff, Gateway admission/grants, the production
cron.updatehandler, andCronService. It rereads the stored jobs after each operation. The scheduler is disabled and no live Gateway is involved.CRON_JOB_NOT_FOUNDCRON_JOB_NOT_FOUNDProof command:
node scripts/run-vitest.mjs src/gateway/server-methods/requester-cron-authority.integration.test.ts— 4/4 pass. An isolated replay with the exact admission module from46aa369b315fails the administrator case; restoring current admission in that same fixture passes all four. Scoped type checks, lint, unused-export checks, and guards pass.openclaw/ci-gatepassed before the final mechanical rebase. ClawSweeper’s completed review was ready with no findings. Both automation commits are patch-identical after rebasing onto main’s Reef fixture repair; the final exact-head CI run 34791023573 and requiredopenclaw/ci-gatepass ata57d239280fb23f9831fa755116133a8db3a9e06.