Repository navigation
fix(ui): preserve advanced cron delivery settings when cloning - #117909
Conversation
5e50c9c to
8b8de25
Compare
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 5:09 AM ET / 09:09 UTC. ClawSweeper reviewWhat this changesThis PR preserves thread routing, completion webhooks, and failure destinations when the Control UI clones or edits a cron automation, while consolidating related UI parsing and protocol-contract helpers. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain Keep this PR open for normal protected-label maintainer review. Current Priority: P1 Review scores
Verification
How this fits togetherThe Control UI reads a stored cron job into an editable form, then sends flowchart LR
A[Stored cron job] --> B[Control UI clone or edit form]
B --> C[Cron request payload]
C --> D[Gateway protocol validation]
D --> E[Scheduler delivery merge]
E --> F[Completion and failure routing]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -144, Tests +77. Total -67 across 40 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the form-level round trip after a redacted after-fix UI or Gateway-runtime artifact confirms that cloning an automation retains its thread, completion, and failure routing without exposing or altering those advanced settings. Do we have a high-confidence way to reproduce the issue? Yes: current main’s clone path reads a job into a form that lacks advanced delivery fields, then creates a new delivery payload from that form. The supplied focused regression test exercises the corresponding after-fix request path, although this review did not execute it. Is this the best way to solve the issue? Yes: retaining protocol-supported values through the existing form/request boundary fixes the lost-state producer without changing scheduler semantics or adding UI configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a0d4aa34661f. 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.
|
…law#117909) * refactor(ui): consolidate task and log contracts * fix(cron): preserve advanced delivery routing * refactor(ui): share relative-time bucketing * fix(ui): retain narrow cron view types * fix(ui): keep cron form field keys total * style(ui): use narrowed task result boolean
What Problem This Solves
Fixes an issue where users cloning an automation could silently lose its thread routing, completion webhook, or failure destination. It also removes independently maintained Control UI copies of task, log, session-key, and relative-time contracts that had already drifted from their core owners.
Why This Change Was Made
Gateway-protocol schemas now own task and cron wire validation, the core log parser owns persisted log interpretation, the UI session module owns channel-style session-key parsing, and normalization-core owns pure relative-time bucketing. The cron form carries non-editable delivery fields through clone/edit submissions, while retaining its intentionally narrower compile-time view type where generated TypeBox types widen UI-critical fields. The cron history schema/codec now preserve the core
tls_certificatefailover reason.The duplicate task adapter, UI log parser, literal-string protocol policing, and repeated time bucketing branches were removed. Production code is net -147 lines; tests are net +80 lines.
User Impact
Cloned automations retain advanced delivery routing instead of silently changing where completion and failure notifications go. Task and log displays now follow their canonical gateway/core contracts, including complete persisted log messages and forward-compatible task metadata. There is no visual styling change, so screenshots are not applicable.
Evidence
node scripts/run-vitest.mjs packages/normalization-core/src/format.test.ts src/infra/format-time/format-time.test.ts src/logging/parse-log-line.test.ts src/cron/cron-protocol-conformance.test.ts src/cron/task-run-history.test.ts ui/src/lib/format.test.ts ui/src/lib/sessions/session-key.test.ts ui/src/lib/sessions/grouping.test.ts ui/src/lib/tasks/data.test.ts ui/src/lib/workboard/index.test.ts ui/src/pages/logs/data.test.ts ui/src/lib/cron/index.test.ts ui/src/lib/presenter.test.ts— 5 shards, 13 files, 515 tests passed after rebasing onto currentorigin/main.validateCronAddParamsandvalidateCronUpdateParamswith numeric and string thread IDs plus completion/failure destinations.git diff --checkand touched-fileoxfmt— passed.autoreview --mode local— clean after implementation and after each CI-driven correction; no accepted/actionable findings.9ec81d158a365a4c0a91a6bb1549ed9548ff5b7e, including production types, test types, lint, build, and test matrix.node scripts/check-changed.mjscould not acquire a configured Crabbox provider locally; hosted CI supplied the required heavy proof for this no-node_modulesworktree.AI-assisted: yes. I reviewed the complete diff and understand the ownership and behavior changes.