Skip to content

fix(tray): editing a cron job saves a timezone it did not have - #1662

Merged
shanselman merged 5 commits into
openclaw:mainfrom
SebTardif:fix/f056-cron-timezone-preserve
Oct 15, 2026
Merged

shanselman merged 5 commits into
openclaw:mainfrom
SebTardif:fix/f056-cron-timezone-preserve

Conversation

@SebTardif

@SebTardif SebTardif commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: editing a cron job can save a timezone the job did not have when the reused form retains another job's selection.

User Impact

User impact: absent timezones remain absent, unlisted timezones are retained until explicitly replaced or the schedule kind changes, and another job or new-job form does not inherit the previous timezone.

Why This Change Was Made

The editor clears the combo for every edit, preserves only an unlisted timezone, and clears preserved state on form lifecycle boundaries. Current main was merged without rewriting the contributor's history. The behavior and tests from #1666 (fix(tray): a cron job stays marked running after the gateway says it is not) remain intact.

A durable, opt-in cron fixture and two real-app UI tests replace the temporary proof harness. Stable automation IDs and the existing localized Edit name make targeting reliable without changing editor behavior. No second production cron state owner or new MCP command was added.

Evidence

Verified head: 7738428a04f21209eb2e81f39b90c79acf4471e4. Required CI Gate passed. Both fixture UI tests passed, zero skips, across four isolated app lifetimes in 26.6 seconds. The app's recorded product version contains this commit. Every save changes the expression and asserts all other fixture jobs are unchanged, preventing unchanged initial data or a save to the wrong job from passing.

The actual app sent these schedules, which the in-memory fixture stored and returned through cron.list:

cron.update listed    {"kind":"cron","expr":"11 7 * * *","tz":"America/Chicago"}
cron.update absent    {"kind":"cron","expr":"12 7 * * *"}
cron.update unlisted  {"kind":"cron","expr":"13 7 * * *","tz":"Pacific/Auckland"}
cron.update unlisted  {"kind":"cron","expr":"14 7 * * *","tz":"UTC"}
cron.update every     {"kind":"cron","expr":"15 7 * * *"}
cron.add    created-4 {"kind":"cron","expr":"11 7 * * *"}
cron.update unlisted  {"kind":"cron","expr":"11 7 * * *"}
cron.update absent    {"kind":"cron","expr":"11 7 * * *"}

The lifecycle test independently repeats the new-job reset and unlisted-kind-switch case for both Every and At, then opens a different job directly from an unlisted edit. All save without tz.

The current-head editor below has no listed selection while retaining Pacific/Auckland in the saved schedule:

Current-head unlisted timezone editor with no listed selection

Explicitly selecting UTC replaces that preserved value:

Current-head editor after explicit UTC selection

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: cron edit/save and form lifecycle behavior. The coordinator-reserved current-head fixture pass completed successfully; owned-window screenshots and saved schedules are above. No broader pool inventory or production Gateway scheduling claim is made.

Validation

With OPENCLAW_REPO_ROOT set to this isolated worktree, on 7738428a:

  • .\build.ps1: passed, all five projects and documentation validation.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger 'console;verbosity=quiet': 4,312 passed, 36 skipped, 0 failed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger 'console;verbosity=quiet': 4,077 passed, 0 failed.
  • dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --filter 'FullyQualifiedName~Cron' --logger 'console;verbosity=quiet': 15 passed, 0 failed, including timezone and running-latch regressions.
  • dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 -p:Platform=ARM64 -p:DevBuild=false --no-restore --filter 'FullyQualifiedName~GatewayFixtureUiTests.CronEditor_' --logger 'console;verbosity=normal' --logger 'trx;LogFileName=cron-proof-7738428a.trx' --results-directory '<session-artifacts>\cron-proof-7738428a': 2 passed, 0 skipped, 0 failed. Opt-in fixture environment and the exact app executable were set as documented in docs/GATEWAY_FIXTURE_TESTING.md.
  • Rubber-duck reviews completed. Findings addressed include cross-job combo cleanup, wrong-target false positives in proof, valid partial fixture updates, and preserving the dynamic Run-now accessible name by limiting the explicit localized name to Edit. No blocking finding remains.
  • Current-head CI: 38689503929, attempt 2 passed, including required CI Gate. The first attempt had two unrelated setup process-timeout assertions and a network-recovery job timeout; same-head reruns passed without product/test changes. The previous-head UI bootstrap and cancelled revocation reruns also passed, but are not substituted for this head's results.

Real Behavior Proof

  • Environment tested: Windows ARM64, .NET SDK 10.0.402, real WinUI app, authenticated synthetic loopback Gateway, isolated disposable profiles and dedicated MCP ports. No installed settings, pairings, or real jobs were used.
  • PR head or commit tested: 7738428a04f21209eb2e81f39b90c79acf4471e4. Recorded app assembly SHA-256: 20649CC4C60470C368A185F3012633B1A454E2EDD92AF19C5D7E0383DE8741EC.
  • Exact steps or command run: the two GatewayFixtureUiTests.CronEditor_ tests above. Navigate to Cron; verify owned HWND/process/physical click target; expand the target card; edit and save through actual controls; verify accepted gateway requests, changed expressions, exact saved schedules, and unchanged other jobs. Combo lookup is scoped to its selection container, and transient UIA tree loss is bounded polling, not success.
  • Evidence after fix: screenshots and copied schedule receipts above. Passing fixture run IDs: 8b66c3926b454ea78aa4f6f9d3d95733, 3327b5a3c47948bc8e847f29de0e300e, 383ff6618d264bbf8d6a4ef3eeb1cd8d, 82fb7aaf4e864adab651411e86637333. The tests, fixture, replay command and screenshots are retained; local TRX and JSON receipts also remain in session artifacts.
  • Observed result: all requested timezone preservation, explicit replacement, cross-job, kind-switch, cancel/reopen and new-job paths passed. All owned app/fixture/testhost processes were confirmed stopped and the desktop reservation released.
  • Screenshot or artifact links verified? Yes. Both images were inspected locally and verified by authenticated HTTP GET after publication: status 200, content type image/png.
  • Not verified or blocked: production Gateway persistence/scheduling is not claimed by this synthetic fixture. The temporary harness/input-targeting limitation is resolved, and required exact-head CI is clean.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No production changes; fixture-only cron replies are explicit opt-in and never execute or forward jobs.
  • Command or tool execution surface changed? No
  • Data access scope changed? No
  • If any answer is Yes, explain the risk and mitigation: N/A

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No production changes; proof uses existing fixture opt-in variables.
  • Migration needed? No
  • If yes, list the exact upgrade steps: N/A

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

The stale proof request on 23120e60 is answered by the current-head fixture evidence above. A fresh advisory ClawSweeper review was requested; no unresolved inline review threads remain.

Editing a cron job only selected the timezone combo when the zone
was already in the list. An empty zone, or a zone that was not
listed, left the previous selection in place. Save then wrote that
leftover zone into the job.

Clear the combo when the job has no zone. Keep an unlisted zone
until the user picks a listed one.

CronScheduleTimezoneTests passed 5. ./build.ps1 exit 0. Shared 4262
passed, 33 skipped. Tray 3995 passed.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge.

What this changes

The cron editor clears stale timezone selections and preserves an existing unlisted timezone until the user chooses another.

Example: Edit a job with no timezone after editing a job using America/Chicago.

  • Before: Saving can assign America/Chicago to the job that had no timezone.
  • After: Saving omits tz unless the user explicitly chooses a timezone.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused patch appears correct and retains the existing serialized schedule format, but supplied runtime evidence does not cover the latest editor-state changes.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Saving an edited cron job can silently replace its timezone with a selection left over from another job.
Reason: Preserving the job's existing schedule is the expected editing contract, and the changes stay within that repair.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR addresses a concrete bug still present on current main; the focused fix remains necessary, and no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 23120e6001b6fbb3837d9f6dd931f9c8c4f2c5d4

Before merge

  • Add real behavior proof - The Windows tray editor trace at 74a81c0 proves four timezone payloads through the shipped UI and client to a loopback endpoint, but the current head adds cleanup paths not exercised there. Supply current-head editor output for sequential listed, absent, and unlisted jobs, explicit timezone selection, and switching between cron and other schedule kinds, with the declared Windows interactive pool result or its explicit blocker; redact private endpoints and credentials. Production gateway persistence was explicitly blocked by pairing. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.

Findings

None.

Tests

  • Low-value test tests/OpenClaw.Tray.Tests/CronScheduleTimezoneTests.cs: Remove StartingAnotherEdit_ReplacesPreviouslyPreservedState: it calls a stateless helper twice and repeats the empty/unlisted cases without exercising replacement of the page's retained state.
  • Missing end-to-end proof: Current-head Windows editor proof is missing for switching jobs and schedule kinds; the supplied runtime trace predates those changes, and no base-fail/head-pass UI regression run is shown.
Agent review details

How this fits together

CronPage reads gateway job schedules into a shared WinUI editor, builds schedule patches, and sends them through OpenClawGatewayClient using cron.update.

flowchart LR
  A[Gateway cron list] --> B[Cron job view model]
  B --> C[WinUI editor]
  C --> D[Timezone preservation policy]
  D --> E[Schedule patch]
  E --> F[Gateway cron update]
Loading

Technical review

Best possible solution:

Land the focused editor-state repair once the current changed paths have the required Windows proof.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows that opening an absent or unlisted timezone leaves the previous selection intact and Save writes that selection; no runtime reproduction was attempted during this read-only review.

Is this the best way to solve the issue?

The fix addresses the shared editor state directly, preserves existing timezone values, and uses the existing gateway update path without adding settings or changing the schedule format.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e4999c6d43f.

Provenance checked

  • Cron editor timezone initialization and save keeps the original intent (61fcd39: The merged cron redesign added inline schedule editing and timezone selection; its PR describes editing support rather than intentional replacement of an absent or unsupported timezone.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Current main still contains the bug: Editing calls SelectComboByTag without clearing the previous timezone, and saving serializes the selected tag; an absent or unlisted timezone therefore leaves stale editor state available for saving. (src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs:334, 9e4999c6d43f)
  • Verified introduced changes: The pinned introduction diff clears the combo before every edit, preserves unlisted zones, resolves the saved timezone, and clears preserved state on cancel, successful save, reset, and leaving cron mode. (src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs:331, 23120e6001b6)
  • Original editor intent: The timezone selection and serialization appear to date to the cron editor redesign in feat(cron): Redesign Cron Jobs page with card UI, inline editing, and run history #313 (feat(cron): Redesign Cron Jobs page with card UI, inline editing, and run history); its stated purpose was editing job schedules, with no documented intent to replace their timezone implicitly. (src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs:334, 61fcd3902764)
  • Earlier editor proof and maintainer discussion: The full PR body supplies four Windows editor saves at 74a81c0 through a loopback endpoint, showing absent, listed, unlisted, and explicitly selected timezones. karkarl requested the declared Windows proof pool in fix(tray): editing a cron job saves a timezone it did not have #1662 (comment); that pool remains explicitly unexecuted. (74a81c04305d)
  • Policy applied: Read the full root AGENTS.md, proof-validation skill, and proof-pool guidance; no nested AGENTS.md or maintainer-notes directory was found. The read-only review ran no builds, tests, helper, or second reviewer and left the checkout clean. (AGENTS.md, 23120e6001b6)
  • Checks and history limits: Exact-head checks show 11 successes, four skips, five still running, and no failures. Scoped history and blame identify the editor and later area contributors; some older objects are unavailable locally, limiting deeper historical inspection without affecting the verified current behavior. (23120e6001b6)

Likely related people:

  • Christine Yan: Raw commit 61fcd39 adds src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs:138 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 61fcd3902764; files: src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs)
  • Régis Brid: Raw commit 638386e adds src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs:928 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 638386ed73ae; files: src/OpenClaw.Tray.WinUI/Pages/CronPage.xaml.cs)

Labels

Label changes:

  • 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.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.

Label justifications:

  • P2: Editing an existing cron job can silently change its scheduling timezone, with impact limited to this editor workflow.
  • 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.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-07T01:49:39.651Z sha ddd2b80 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T02:16:47.856Z sha 74a81c0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T12:37:26.164Z sha 74a81c0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-07T13:32:17.637Z sha 74a81c0 :: needs maintainer review before merge. :: none

Reviewed October 15, 2026, 12:48 AM ET / 04:48 UTC (Revision 5).

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 7, 2026
@karkarl

karkarl commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Global triage: NEEDS_HUMAN_TEST. Take confidence 55%; recommendation confidence 97%; effort small; risk medium.

Reviewed exact head 74a81c04305d. GitHub currently reports CLEAN with 29 passing, 0 failing, and 0 pending checks. proof label is sufficient. Durable automated signal: Codex review: needs maintainer review before merge..

Maintainer or proof-pool owner: run every declared Windows proof pool at this exact head and replace blocked or historical evidence with current-head results.

This is a triage classification, not a merge action. No branch changes were made.

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 15, 2026
Preserve both cron timezone editing and the running-state latch behavior added by openclaw#1666.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f66f0e00-0c9b-4632-8bc4-9dae1cd81754
Ensure every edit starts with an empty timezone combo before applying cron-specific state, and cover all preserved-state cleanup paths.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f66f0e00-0c9b-4632-8bc4-9dae1cd81754
@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. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: sufficient Contributor real behavior proof is sufficient. labels Oct 15, 2026
@shanselman shanselman added status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. and removed status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Oct 15, 2026
Add explicit in-memory cron fixture responses and owned-window UI coverage for timezone preservation, replacement, and form lifecycle transitions. Expose stable cron title/action IDs and the localized Edit action name without changing editor behavior.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: f66f0e00-0c9b-4632-8bc4-9dae1cd81754
@shanselman

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

Current-head proof is now attached for 7738428. The retained CronEditor_ tests passed 2/2 with zero skips across four isolated app lifetimes. The PR body contains inspected editor screenshots and saved schedule receipts for listed, absent, unlisted, explicit UTC, job switching, Every/At transitions, cancel/reopen, and new-job reset. Every save changes the expression and verifies all other jobs remain unchanged; the repeated stateless helper check is not being used as lifecycle evidence.

Full build, Shared (4312 passed, 36 skipped), Tray (4077 passed), and focused cron (15 passed) are clean locally. Required CI is still gated: two setup process-timing failures and a network-recovery timeout are being rerun on the exact same head. No merge until the required CI gate passes.

@clawsweeper

clawsweeper Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@shanselman
shanselman merged commit 846ba0e into openclaw:main Oct 15, 2026
43 of 46 checks passed
@shanselman shanselman added proof: sufficient Contributor real behavior proof is sufficient. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 15, 2026
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 15, 2026
@SebTardif
SebTardif deleted the fix/f056-cron-timezone-preserve branch October 16, 2026 01:14
@clawsweeper clawsweeper Bot mentioned this pull request Oct 23, 2026
8 of 16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants