Repository navigation
test: scheduled-command demotion case depends on test order - #180818
fuller-stack-dev merged 1 commit into
Conversation
The capacity blocker in the scheduled-command harness enqueued with maxConcurrent 1, but every swarm reservation re-applies the configured lane limit (default 32), so the child's own reservation widened the lane and it launched immediately. Whether it was still queued when the test acted depended on module-load timing: the first test in a file was slow enough, later tests were not, so a demotion in a second test landed after the child had already passed admission. Pin the configured swarm limit to one in a shared hold helper, assert the child holds a reservation without launching before acting, and split the queued-child authorization cases back into separate tests.
|
🦞👀 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. What this changesThis PR pins test swarm capacity, verifies children remain queued, and separates authorized and demoted requester cases. Example: The authorized scheduled-child test runs before the requester-demotion test.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes queued-child authorization tests deterministic, and the defective harness remains on current main; no introduced defects were found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe test harness sends plugin commands through the real scheduler and native-child admission owners, then observes queued reservations and terminal authorization outcomes. flowchart LR
A[Plugin command fixture] --> B[Scheduled occurrence]
B --> C[Native child reservation]
D[Capacity blocker] --> C
C --> E[Requester authority recheck]
E --> F[Observed terminal outcome]
Technical reviewBest possible solution: Keep the shared configuration-backed capacity hold and separate authorization cases without changing production scheduling. Do we have a high-confidence way to reproduce the issue? Source confirms that child reservations overwrite the blocker's lane limit; the author reports an order-dependent baseline failure and targeted mutation checks, but this review ran no tests. Is this the best way to solve the issue? The patch repairs fixture configuration at the existing capacity owner, shares repeated setup, and retains distinct lineage, authorized-admission, and demotion failures without production machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 827aae9c0bf1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +26. Total +26 across 2 files. Added test files: 1. View PR surface stats
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 Reviewed October 22, 2026, 1:35 PM ET / 17:35 UTC. |
…ly (openclaw#180818) The capacity blocker in the scheduled-command harness enqueued with maxConcurrent 1, but every swarm reservation re-applies the configured lane limit (default 32), so the child's own reservation widened the lane and it launched immediately. Whether it was still queued when the test acted depended on module-load timing: the first test in a file was slow enough, later tests were not, so a demotion in a second test landed after the child had already passed admission. Pin the configured swarm limit to one in a shared hold helper, assert the child holds a reservation without launching before acting, and split the queued-child authorization cases back into separate tests.
Related: #180282
What Problem This Solves
Fixes: in the scheduled plugin-command tests, a requester demotion in one test was ignored whenever the authorized test ran first in the same file. Because of that, the queued-child authorization cases had been combined into a single test.
User Impact
No user-visible change. The tests now run deterministically: the demotion case fails only when the product check fails, not because of test order.
Why This Change Was Made
No authority cache or registry state was leaking between tests. The harness meant to keep the child queued, but it never did:
maxConcurrent: 1, but every swarm reservation re-applies the configured lane limit (default 32), so the child's own reservation widened the lane and the child launched at once.The fix:
Production code is unchanged.
Evidence
All runs used a private HOME, state, TMPDIR and handoff store.
published reply runtime missinginstead of the authority refusalcommands-plugin.scheduled-turns.test.ts, after the fix (re-run after rebasing onto currentmain)operator-run-recovery.tstsgocore test graphs, type-aware oxlint (includingmax-lines),oxfmt,check:test-mock-exports,git diff --checkThe other S6 follow-ups need no code change. Their proof is in a separate comment on #180282: a real provider call by a scheduled child on an isolated Gateway, and an upgrade from v2026.10.5 through
doctor --fixplus a rollback reader.