ui(cron): add advanced controls for run-if-due and routing#31244
ui(cron): add advanced controls for run-if-due and routing#31244Takhoffman merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7607a6ce0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ? form.deliveryChannel.trim() || "last" | ||
| : undefined, | ||
| to: form.deliveryTo.trim() || undefined, | ||
| accountId: form.deliveryAccountId.trim() || undefined, |
There was a problem hiding this comment.
Send explicit accountId clears when editing cron jobs
When a job already has delivery.accountId, clearing the Account ID field in the UI does not remove it: form.deliveryAccountId.trim() || undefined yields undefined, and the gateway request path (ui/src/ui/gateway.ts JSON.stringify(frame)) drops undefined keys, so the cron.update patch omits accountId; on the server, mergeCronDelivery only clears the field when accountId is present in the patch. This leaves stale account routing that users cannot clear from the web editor.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR successfully adds advanced cron controls to the Web UI, bringing feature parity with CLI options. The implementation adds four new capabilities: Key changes:
Implementation quality:
Confidence Score: 5/5
Last reviewed commit: cb9184b |
386fd2c to
8b034bd
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b034bda15
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| state.cronEditingJobId && | ||
| existingLightContext !== undefined | ||
| ) { | ||
| payload.lightContext = false; |
There was a problem hiding this comment.
Persist lightContext changes when updating cron jobs
This change sends payload.lightContext in cron.update, but the update path currently discards that field: mergeCronPayload never applies patch.lightContext and buildPayloadFromPatch also omits it (src/cron/service/jobs.ts:554-582 and src/cron/service/jobs.ts:638-649). In practice, editing an existing job and toggling the new Light context control (especially turning it off) silently does not persist, so the UI suggests a change that the stored cron job never receives.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9df616fc2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| accountId: | ||
| selectedDeliveryMode === "announce" ? form.deliveryAccountId.trim() : undefined, |
There was a problem hiding this comment.
Use explicit clear sentinel for delivery accountId edits
When an existing cron job has delivery.accountId set, clearing the Account ID field still does not remove it: this code sends accountId as an empty string, but the cron.update path normalizes patches with normalizeCronJobPatch, which strips blank delivery.accountId values (src/cron/normalize.ts:198-204) before applyJobPatch runs (src/gateway/server-methods/cron.ts:119-123). That means the patch omits accountId entirely, so the old routing account remains persisted and cannot be cleared from the UI.
Useful? React with 👍 / 👎.
d9df616 to
75f7d28
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75f7d28021
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ...jobToSuggestions, | ||
| ...accountToSuggestions, | ||
| ]); | ||
| const accountSuggestions = uniquePreserveOrder(accountToSuggestions); |
There was a problem hiding this comment.
Restrict account suggestions to IDs for cron delivery routing
accountSuggestions is now fed directly into the new Account ID input, but this list is built from accountToSuggestions, which also contains human-readable account.name values; when a name differs from its real ID, selecting it sends that name as delivery.accountId, and downstream account lookup resolves by account key/ID (not display name), so delivery can route to the wrong/default account or fail for multi-account setups. Keep accountSuggestions ID-only (or translate names back to IDs before submit) for this field.
Useful? React with 👍 / 👎.
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing (cherry picked from commit 254bb7c)
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing (cherry picked from commit 254bb7c)
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
…31244) * ui(cron): add advanced run controls and routing fields * ui(cron): gate delivery account id to announce mode * ui(cron): allow clearing delivery account id in editor * cron: persist payload lightContext updates * tests(cron): fix payload lightContext assertion typing
Summary
Describe the problem and fix in 2–5 bullets:
session-key, deliveryaccount,light-context, and due-only run mode).sessionKey, deliveryaccountId,lightContext, andRun if due(cron.runmodedue).Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Session keyfield.Account IDinput for multi-account channel routing.Light contexttoggle.Run if due, which triggerscron.runin due-only mode.Security Impact (required)
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
Crontab.agentTurnjob.Session key,Account ID,Light context) and useRun if due.Expected
cron.add/cron.updatepayloads.Run if duesendscron.runwith modedue.Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
sessionKeyandlightContext; due-mode run wiring.Compatibility / Migration
Yes/No): YesYes/No): NoYes/No): NoFailure Recovery (if this breaks)
ui/src/ui/controllers/cron.ts,ui/src/ui/views/cron.tsand associated UI type/default files.Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.