Repository navigation
fix(ui): follow active scheduler trigger capability - #126945
Conversation
Control UI automation trigger authoring now reflects the running scheduler across unsaved and saved-but-unapplied config edits and reconnects.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 20, 2026, 10:07 PM ET / August 21, 2026, 02:07 UTC. ClawSweeper reviewWhat this changesThe PR adds scheduler-owned trigger capability to cron status and makes Control UI use it instead of unapplied configuration drafts. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessNo blocking correctness finding. Keep this protected maintainer PR open for normal exact-head CI and merge handling; the patch cleanly moves trigger capability ownership from editable UI drafts to the running scheduler. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherCronService owns active scheduler configuration and exposes status through Gateway RPC. Control UI consumes that status when deciding whether to offer condition-trigger authoring. flowchart LR
A[Active scheduler config] --> B[Cron service]
B --> C[Cron status]
C --> D[Gateway RPC]
D --> E[Control UI]
E --> F[Trigger authoring controls]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +235, Other +1. Total +234 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Make Control UI condition-trigger controls depend solely on the active scheduler capability returned by Gateway, then land the refreshed exact-head implementation. Do we have a high-confidence way to reproduce the issue? Yes. Current main directly reads the editable configuration for trigger availability, and the supplied focused Chromium scenario exercises divergent draft and active scheduler values. Is this the best way to solve the issue? Yes. Publishing the policy from CronService removes the duplicate UI-side reconstruction; retaining the old draft resolver would leave two competing sources of truth. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ab2bbd42dfaf. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
`main` is red: `check-lint-core-5` fails with
ui/src/pages/cron/view.test.ts
1124:4 error File has too many lines (1004). eslint(max-lines)
The file has been growing for a while (1104 lines at fa75cdd, 1116 at
2acfc47) and crossed the 1000 code-line cap at a4b3f63 (#126945). Every
PR opened since inherits the failure, so this is not any one PR's fault to fix
in passing -- it blocks the merge gate for everyone.
Repo policy forbids a `max-lines` suppression, so the file is split along the
seam it already had: three top-level describes, one of which was two thirds of
the file. `cron view editor` moves to `view.editor.test.ts`; `cron view list
pane` and `cron view selects` stay in `view.test.ts`. The four DOM helpers the
blocks shared move into the existing `view.test-support.ts` sibling rather than
being duplicated, and each file imports only what it uses.
No test content changed: 42 tests before, 42 after, same 41 `it(` declarations.
Sizes drop to 373 / 721 / 143 lines, all well under the cap.
Control UI automation trigger authoring now reflects the running scheduler across unsaved and saved-but-unapplied config edits and reconnects.
…aw#127018) `main` is red: `check-lint-core-5` fails with ui/src/pages/cron/view.test.ts 1124:4 error File has too many lines (1004). eslint(max-lines) The file has been growing for a while (1104 lines at b7ec570, 1116 at ed40a7d) and crossed the 1000 code-line cap at 4310d65 (openclaw#126945). Every PR opened since inherits the failure, so this is not any one PR's fault to fix in passing -- it blocks the merge gate for everyone. Repo policy forbids a `max-lines` suppression, so the file is split along the seam it already had: three top-level describes, one of which was two thirds of the file. `cron view editor` moves to `view.editor.test.ts`; `cron view list pane` and `cron view selects` stay in `view.test.ts`. The four DOM helpers the blocks shared move into the existing `view.test-support.ts` sibling rather than being duplicated, and each file imports only what it uses. No test content changed: 42 tests before, 42 after, same 41 `it(` declarations. Sizes drop to 373 / 721 / 143 lines, all well under the cap.
Closes #126944
What Problem This Solves
Fixes an issue where operators editing automation trigger configuration in Control UI could see authoring availability derived from unsaved or saved-but-unapplied drafts instead of the running scheduler. The UI could claim condition triggers were disabled while active jobs still executed, or expose authoring that active runtime policy rejected.
Why This Change Was Made
The running
CronServicenow projects its effective trigger capability as a requiredtriggersEnabledfact in the existingcron.statusresult. Control UI consumes that scheduler-owned status directly and deletes the duplicate draft-config resolver; unknown status exposes neither authoring nor a false disabled claim. No config/hash inference, compatibility fallback, protocol-version bump, generated-client change, or SQLite change is involved.The scheduler status fact remains independent of the global cron enable switch, matching existing execution and validation ownership. Existing configured triggers remain visible and clearable when trigger execution is disabled, and trigger filtering is unchanged.
User Impact
Automation trigger controls now match the Gateway process that will actually accept and execute them. Unsaved edits and saved-but-unapplied configuration no longer change runtime presentation, and reconnect refreshes capability from the replacement scheduler.
Before: an unsaved disable draft falsely claims active triggers are disabled.
After: the same draft leaves authoring available because the running scheduler still permits triggers.
Before: an unsaved enable draft exposes authoring while the active scheduler rejects triggers.
After: the same draft cannot override the scheduler-owned disabled capability.
Evidence
node scripts/run-vitest.mjs src/cron/service.stream-validation.test.ts src/gateway/server.cron.test.ts src/plugins/contracts/scheduled-turns.contract.test.ts ui/src/pages/cron/cron-page.test.ts ui/src/pages/cron/view.test.ts ui/src/pages/cron/view-run-history.test.ts ui/src/pages/agents/view.test.ts— 185 tests passed across four routed shards.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/cron-trigger-authoring.e2e.test.ts ui/src/e2e/cron-trigger-filter.e2e.test.ts— 3 real-Chromium tests passed.git diff --name-only -z | xargs -0 node scripts/check-changed.mjs --— passed all selected core, UI, plugin-contract, extension, scripts, lint, typecheck, database/schema, cycle, and security guards.pnpm build— passed, including the production Control UI bundle.pnpm protocol:check— passed; generated schema, Swift, and Kotlin outputs remained unchanged..claude/skills/autoreview/scripts/autoreview --mode uncommitted— clean; no accepted/actionable findings.Production LOC: +7/-12 (net -5) | Tests: +259/-21 | Development fixture: +1/-0.
AI assistance