Skip to content

fix(ui): preserve advanced cron delivery settings when cloning - #117909

Merged
steipete merged 6 commits into
mainfrom
fix/ui-core-followups
Aug 2, 2026
Merged

steipete merged 6 commits into
mainfrom
fix/ui-core-followups

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

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_certificate failover 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 current origin/main.
  • Cron clone/edit regression requests pass validateCronAddParams and validateCronUpdateParams with numeric and string thread IDs plus completion/failure destinations.
  • git diff --check and touched-file oxfmt — passed.
  • autoreview --mode local — clean after implementation and after each CI-driven correction; no accepted/actionable findings.
  • Hosted CI run 30740041819 — green at exact head 9ec81d158a365a4c0a91a6bb1549ed9548ff5b7e, including production types, test types, lint, build, and test matrix.
  • node scripts/check-changed.mjs could not acquire a configured Crabbox provider locally; hosted CI supplied the required heavy proof for this no-node_modules worktree.

AI-assisted: yes. I reviewed the complete diff and understand the ownership and behavior changes.

@steipete
steipete marked this pull request as ready for review August 2, 2026 08:21
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: L maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete
steipete force-pushed the fix/ui-core-followups branch from 5e50c9c to 8b8de25 Compare August 2, 2026 08:25
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 5:09 AM ET / 09:09 UTC.

ClawSweeper review

What this changes

This 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 main rebuilds clone delivery from only the visible form fields, so a cloned job drops advanced routing; the patch carries those fields through the form and adds a focused request-contract regression test. The patch appears correct, but the supplied proof is tests/schema validation and CI rather than an after-fix UI/Gateway run.

Priority: P1
Reviewed head: 9ec81d158a365a4c0a91a6bb1549ed9548ff5b7e

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused coverage are strong, but real after-fix behavior proof remains absent from the available PR evidence.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR supplies focused unit/schema-validation evidence and green CI, but no inspected after-fix Control UI or Gateway runtime artifact; add redacted terminal, browser, or runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR supplies focused unit/schema-validation evidence and green CI, but no inspected after-fix Control UI or Gateway runtime artifact; add redacted terminal, browser, or runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current clone path omits advanced delivery fields: On current main, jobToForm copies only the visible delivery settings, and addCronJob constructs a fresh delivery object from that form. A cloned job is submitted through cron.add, so thread routing, completion destination, and failure destination are not carried into the new job.
Patch preserves and validates the missing fields: The PR records protocol-supported advanced delivery values in form state, includes them when constructing create/update requests, and tests clone plus edit payloads with the canonical Gateway validators.
Regression coverage: The focused test clones a job with numeric thread routing, a completion webhook, and a failure destination; it asserts the cron.add payload is identical and checks both add and update payloads against Gateway schemas.
Findings None None.
Security None None.

How this fits together

The Control UI reads a stored cron job into an editable form, then sends cron.add for clones or cron.update for edits. The Gateway validates those payloads and the scheduler persists delivery policy that determines where completion and failure notifications are sent.

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]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR supplies focused unit/schema-validation evidence and green CI, but no inspected after-fix Control UI or Gateway runtime artifact; add redacted terminal, browser, or runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Merging changes the delivery policy sent for cloned automations; the focused tests prove request construction, but no supplied artifact shows a running Control UI and Gateway retaining those destinations end to end.
  • Complete next step (P2) - The protected maintainer label and missing direct behavior artifact require human PR handling rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Source -144, Tests +77. Total -67 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 26 172 316 -144
Tests 14 233 156 +77
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 405 472 -67

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/logging/parse-log-line.test.ts, serialized state: src/logging/parse-log-line.ts, serialized state: ui/src/lib/sessions/grouping.ts, serialized state: ui/src/lib/sessions/session-key.test.ts, serialized state: ui/src/lib/sessions/session-key.ts, serialized state: ui/src/pages/logs/log-lines.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Add direct clone-path proof before merge (recommended)
    Capture a redacted Control UI or Gateway runtime result showing the cloned job retains advanced delivery fields, then merge the focused repair.
  2. Accept the focused contract proof
    A maintainer may merge based on the schema-validated regression test and green CI while accepting the absence of a direct runtime artifact.

Technical review

Best 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.

Labels

Label changes:

  • add P1: A clone can silently remove configured completion or failure routing from an existing automation.
  • add merge-risk: 🚨 message-delivery: The patch changes the advanced delivery fields the Control UI includes in cron create and update requests.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR supplies focused unit/schema-validation evidence and green CI, but no inspected after-fix Control UI or Gateway runtime artifact; add redacted terminal, browser, or runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: A clone can silently remove configured completion or failure routing from an existing automation.
  • merge-risk: 🚨 message-delivery: The patch changes the advanced delivery fields the Control UI includes in cron create and update requests.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR supplies focused unit/schema-validation evidence and green CI, but no inspected after-fix Control UI or Gateway runtime artifact; add redacted terminal, browser, or runtime output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current clone path omits advanced delivery fields: On current main, jobToForm copies only the visible delivery settings, and addCronJob constructs a fresh delivery object from that form. A cloned job is submitted through cron.add, so thread routing, completion destination, and failure destination are not carried into the new job. (ui/src/lib/cron/index.ts:758, a0d4aa34661f)
  • Patch preserves and validates the missing fields: The PR records protocol-supported advanced delivery values in form state, includes them when constructing create/update requests, and tests clone plus edit payloads with the canonical Gateway validators. (ui/src/lib/cron/index.ts:809, 9ec81d158a36)
  • Regression coverage: The focused test clones a job with numeric thread routing, a completion webhook, and a failure destination; it asserts the cron.add payload is identical and checks both add and update payloads against Gateway schemas. (ui/src/lib/cron/index.test.ts:1571, 9ec81d158a36)
  • Feature-history provenance: Blame attributes both the current UI form mapping and scheduler delivery merge to the recent central cron refactor, which establishes the same owner boundary for this follow-up repair. (ui/src/lib/cron/index.ts:800, e7f1202bbb39)
  • Available validation and discussion evidence: The supplied PR body reports 515 focused tests, Gateway schema checks, formatting, and a green hosted CI run at the reviewed head. A live GitHub API read for the filtered bot comment and any attachment failed because the environment could not resolve api.github.com. (9ec81d158a36)

Likely related people:

  • steipete: Current-main blame ties the central Control UI mapping and scheduler merge to Peter Steinberger’s recent cron refactor; this PR is a focused follow-up on the same boundary. (role: current feature owner; confidence: high; commits: e7f1202bbb39, 19513ed427d7; files: ui/src/lib/cron/index.ts, src/cron/service/jobs.ts, packages/gateway-protocol/src/schema/cron.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Post a redacted terminal, browser, or Gateway-runtime artifact showing a cloned job retains advanced delivery routing.
  • If the PR body update does not trigger a fresh review, ask a maintainer to comment @clawsweeper re-review.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit a5b8b70 into main Aug 2, 2026
135 of 140 checks passed
@steipete
steipete deleted the fix/ui-core-followups branch August 2, 2026 09:13
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant