Skip to content

fix(web): editing a scheduled task shows its saved time when the hour has one digit - #29851

Open
saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/scheduled-task-unpadded-time
Open

saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/scheduled-task-unpadded-time

Conversation

@saphid

@saphid saphid commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The scheduled-task contract accepts a fixed time with a one-digit hour, such as 9:05, and the server stores it unchanged. Agents can save one with the schedule_task MCP tool. When a user opens that task in Settings to edit it, the Run at field is blank. The web form passes the stored string straight into a native <input type="time">, and the browser turns any value that is not HH:MM into an empty string.

If the user then fills in only part of the empty field, the input reports "", and saving falls back to 09:00. The task then runs at a time the user never picked.

Change

taskToDraft pads the stored time to HH:MM (9:05 → 09:05) before it reaches the form. All other contract-valid values are unchanged. Re-saving does not reschedule a pending run, because the server's isSameSchedule already compares parsed times ("padded-hour edits do not reschedule pending runs"). The mobile picker already parses one-digit hours (timePickerValue), so this brings web in line with it.

Scope and approval

Very small, focused fix for an obvious bug, so no prior issue: the edit form does not show a value the server accepts and stores, and the fix is one line plus one test case.

Overlap search: #28021 replaces this input with a custom time-format control and would also pad the hour, but it addresses the 12/24-hour preference and is still open. #19373 and #22801 change the default base branch, and #21792 and #29067 change other editor fields. None of them changes how taskToDraft reads timeOfDay on main.

Verification

  • Red on main: vp test run src/components/settings/scheduledTasksSettings.logic.test.ts fails the new case with AssertionError: expected '9:05' to be '09:05'.
  • Green: the same file passes, 23/23.
  • vp run check:changed: format, lint, knip, typecheck, tests, and react compiler all pass.
  • Browser behavior, checked in Playwright Chromium (the same engine as Electron): setting input[type=time].value to "9:00" or "9:05" reads back "", and "09:00" reads back "09:00".
  • Not checked: before/after captures in a running client. The defect is the value passed to the input, which the test covers.

Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

… has one digit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 3, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 0386632

Macroscope's review found this PR approvable — Saved single-digit hours are padded so scheduled-task editing displays the existing time correctly. The change preserves the intended schedule and leaves defaults unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

taskToDraft now pads fixed-time schedule values to five characters. A test checks that the stored value "9:05" becomes "09:05" in the form draft.

Changes: Scheduled-task time draft

Layer / File(s) Summary
Fixed-time draft conversion
apps/web/src/components/settings/scheduledTasksSettings.logic.ts, apps/web/src/components/settings/scheduledTasksSettings.logic.test.ts
taskToDraft pads fixed-time values to five characters. The test verifies that "9:05" becomes "09:05"; other schedule types still use "09:00".

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: size:XS

Suggested reviewers: macroscopeapp

Merge Risk: Minimal · up to 03866

No merge-blocking issues were identified in the scheduled-task time-padding change.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title names the specific bug and its fix: a scheduled task's saved time shows in the edit form when the hour has one digit. The change pads a one-digit hour in taskToDraft, so the title matches th…
Description check Passed The description covers the problem, the change, scope and approval, and verification, so it matches the repository template. The Problem section gives the one-digit hour behavior, the blank Run at fie…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the specific bug and its fix: a scheduled task's saved time shows in the edit form when the hour has one digit. The change pads a one-digit hour in taskToDraft, so the title matches the changeset. It is clear, concise, and follows the conventional commit style that the template suggests.

Full details: Description check

Explanation

The description covers the problem, the change, scope and approval, and verification, so it matches the repository template. The Problem section gives the one-digit hour behavior, the blank Run at field, and the fallback to 09:00. The Change section explains the taskToDraft padding and why pending runs are not rescheduled. The Scope section explains why no prior issue is needed and lists overlapping PRs. The Verification section gives a red-then-green test result, the check:changed result, and a Playwright browser check. It also states what was not checked: before/after captures in a running client. The template asks for before/after screenshots for UI changes, so that gap is real. The description also omits the model and harness line, which the template asks for when an agent was used, although the description does name Claude Code and a reviewer model. These are minor gaps, and the description is mostly complete.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/scala/security/command-injection-sys-process-scala.yml

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e0f69e9 and 0386632.

Files selected for processing: 2
  • apps/web/src/components/settings/scheduledTasksSettings.logic.test.ts
  • apps/web/src/components/settings/scheduledTasksSettings.logic.ts

Limit details: You’ve used all 10 included reviews currently available.

@maria-rcks

maria-rcks commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified unchanged head 0386632c176fc997dc0a05961bcd8827064c8ca1 on this linux boat vm. ran vp i and background vp run dev separately on github/main (61c3794c32) and the exact pr head, with one server running at a time and isolated state. drove the actual web client using repo playwright and /usr/bin/google-chrome.

on both versions, added a project pointing at the real checkout and sent a real codex gpt-6.1-sol turn that called schedule_task with {"type":"fixed_time","timeOfDay":"9:05"}. no mocks, fixtures, or demo data.

  • main: settings > scheduled tasks > edit showed a blank run-at field, despite the persisted 9:05 schedule.
  • pr: the matching editor showed 09:05. saving and reopening preserved the time and pending next run. the automation edit button in chat also showed 09:05.
  • nearby behavior: changing the minute to 09:07 persisted and moved the next run to 09:07. restored 09:05, then clicked run now. a real codex turn replied schedule verification ok; the server recorded success and preserved the daily next run.

read-only database observations from the running app:

agent-created: timeOfDay="9:05", model="gpt-6.1-sol", creation_source="mcp"
pr editor: input.value="09:05"
after save/reopen: timeOfDay="09:05", next_run_at="2026-11-03T09:05:00.000Z"
after minute edit: timeOfDay="09:07", next_run_at="2026-11-03T09:07:00.000Z"
after restore + run now: timeOfDay="09:05", next_run_at="2026-11-03T09:05:00.000Z"
last_run_status="succeeded", last_run_error=null, run_count=1

blacksmith checks passed: scheduledTasksSettings.logic.test.ts 23/23 and Schedule.test.ts 2/2. the head also has 24 passed and 7 skipped ci checks. no code changes or pushes were needed.

main, with the blank saved time:

main edit form has a blank run-at field for the saved 9:05 task

pr, with the same task values:

pr edit form shows 09:05 for the saved 9:05 task

saving and reopening the editor:

saving and reopening retains the scheduled 09:05 time

real provider execution through run now:

codex automation completes with schedule verification ok

Not verified

native ios/android clients and the electron shell on macos/windows were not exercised on this linux vm. remote/relay/tunnel connections, other providers, and waiting until the daily 09:05 wall-clock trigger were not exercised. run now exercised real server dispatch and provider completion; the saved daily timestamp was checked separately.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants