🤖 feat: centralize workflow automations#3560
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f7019ae60
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f7019ae60
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
0f7019a to
12c884b
Compare
|
Addressed the current Codex findings:
Also fixed CI-local repro failures by only expecting the automation modal test double when it is mounted, and wrapping AgentListItem stories in ProjectProvider. @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12c884b9b3
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
12c884b to
c1157ac
Compare
|
Addressed the latest Codex findings:
Also changed @codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1157ac7f8
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c1157ac to
fef4720
Compare
|
Addressed the latest Codex finding:
Validation for this round:
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
fef4720 to
b625368
Compare
|
Pushed a unit-test isolation fix after the latest CI failure: Validation:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b62536819c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b625368 to
46fb7f6
Compare
|
@codex review Please take another look. Addressed the missing/deleted project target stamping case and added a project automation keyboard shortcut path. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46fb7f6145
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
46fb7f6 to
b06d98a
Compare
|
@codex review Please re-check after the Storybook play-test selector fix. |
b06d98a to
ae6ec2b
Compare
|
@codex review Please take another look. Preserved existing project automation titles when saving from the workspace automation modal and covered it in the modal test. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae6ec2b015
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ae6ec2b to
4d8b0a0
Compare
|
@codex review Please take another look. Project automation fresh workspaces now use template workspaces only for runtime settings and do not inherit a template sub-project scope; added serviceContainer coverage for that case. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d8b0a089c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4d8b0a0 to
d0b1d03
Compare
|
@codex review Please take another look. The project automation shortcut now resolves the selected workspace's effective sub-project scope, matching the new-workspace shortcut behavior, with ProjectSidebar coverage. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0b1d036d4
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d0b1d03 to
365f1a9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 365f1a9715
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
365f1a9 to
dd5652d
Compare
|
@codex review Please take another look. Saving new-workspace schedules for sub-projects now validates against the owner project's workspace templates, and project trust now resolves through the registered parent project so sub-project workflow runs can load project-local definitions under a trusted parent. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd5652debe
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dd5652d to
2324f84
Compare
|
@codex review Please take another look. WorkspaceMenuBar now opens/saves workspace automation schedules under the effective sub-project path, and project schedule dispatch resolves existing-workspace targets through the owner project so sub-project-owned schedules can run against parent-owned workspaces. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2324f84749
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
2324f84 to
8733cb3
Compare
|
@codex review Please take another look. AutomationModal now loads workflow definitions from the effective sub-project path, ProjectAutomationsModal uses owner-project workspaces for sub-project target options, and existing-workspace conflicts are checked across the owner project plus registered sub-project schedules. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8733cb3f7c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Promote scheduled workflow automations from workspace-local state into project-level schedules that survive workspace archival and deletion. - add project workflow schedule schemas, oRPC endpoints, and scheduler dispatch support - support existing-workspace and new-workspace automation targets with conflict validation - add modal UI, menu entries, stories, and tests for configuring and running automations - harden workflow scheduling around terminal status, stale config stamps, and unsupported targets - remove unshipped legacy workspace automation migration plumbing --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$632.46`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=632.46 -->
8733cb3 to
67d7471
Compare
|
@codex review Addressed the three unresolved findings:
Local validation after rebasing onto
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67d7471046
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the latest findings:
Local validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53cb8b3e7f
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the latest two findings:
Local validation:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c45c310876
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Addressed the sibling project automation lookup finding:
Local validation:
|
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary Long-lived auto-cleanup PR maintained by the **Auto-Cleanup Agent**. Each pass lands at most one extremely low-risk, behavior-preserving cleanup drawn from recently merged `main` activity, then advances the checkpoint below. ## This pass Replaced an inline terminal-status check in `WorkflowService.interruptRunOnAbort` (`src/node/services/workflows/WorkflowService.ts`) with the `isTerminalWorkflowRunStatus` helper introduced by coder#3587 ("show workflow-only sidebar activity"). The guard ```ts if ( run == null || run.status === "completed" || run.status === "failed" || run.status === "interrupted" ) { return; } ``` now reads `if (run == null || isTerminalWorkflowRunStatus(run.status))`. - **Behavior-preserving:** `isTerminalWorkflowRunStatus(status)` is defined as `status === "completed" || status === "failed" || status === "interrupted"` — byte-for-byte the same three-status disjunction (same short-circuit order, same boolean result), so the `run == null || ...` early-return is unchanged. - **Why it helps:** `isTerminalWorkflowRunStatus` is already the canonical terminal-status predicate everywhere else (`taskService.ts`, `tools/task_await.ts`); this was the only remaining hand-inlined copy in `WorkflowService`, so the dedup keeps the terminal-status set defined in exactly one place. - **Scoped:** one file, one guard; the helper was already exported from `@/common/types/workflow` and is now added to the existing import in `WorkflowService.ts` (next to the already-imported `isActiveWorkflowRunStatus`). ## Validation - `bun test src/node/services/workflows/WorkflowService.test.ts` — 58 pass / 0 fail. - `make static-check` — eslint, tsc (both configs), Prettier, and the generated workflow-runtime bundle drift check all pass. The only failing step is `fmt-shell-check`, which requires `shfmt` (not installed in this environment); no shell scripts were touched, so CI (which has `shfmt`) is unaffected. <details> <summary>Prior passes</summary> - Deduplicated the identical `workspaceId`-only metadata JSON Schema that three id-targeted host actions repeat in `src/node/services/workflows/workspaceHostActions.ts` into a module-level `WORKSPACE_ID_ONLY_INPUT_SCHEMA` constant (the third copy was introduced by coder#3583 when it added `workspace.unarchive`). Behavior-preserving: nothing mutates the metadata, and the shared constant has identical key order/values so the generated stub bundle is byte-identical (drift check passing). - Extracted a shared `BlockedBadge` component in `src/browser/features/Tools/WorkflowDefinitionToolCall.tsx` to deduplicate the `<WorkflowBadge tone="danger">blocked</WorkflowBadge>` markup that coder#3578 introduced verbatim in three spots. Also resolved a trivial rebase conflict from coder#3582 in `src/node/services/workflows/workflowArgs.ts`. - Deduplicated the repeated `"Workflow metadata.argsSchema.properties must be an object"` error string in `src/node/services/workflows/workflowArgs.ts` (added in coder#3575) into a module-level `ARGS_SCHEMA_PROPERTIES_ERROR_MESSAGE` constant. - Deduplicated the four mocked-module specifier strings in `src/browser/hooks/useModelsFromSettings.test.ts` into shared local constants so `installUseModelsModuleMocks()` / `restoreUseModelsModuleMocks()` can't drift (after coder#3574). - Removed a redundant `toggleWorkflowExpanded` wrapper in `src/browser/features/Tools/WorkflowRunToolCall.tsx`, left behind by coder#3571. - Deduplicated two repeated fallback error strings in `src/browser/components/AutomationModal/AutomationModal.tsx` (after coder#3560) into `SAVE_AUTOMATION_ERROR_MESSAGE` / `REMOVE_AUTOMATION_ERROR_MESSAGE` module-level constants. - Replaced a duplicated `"wfr_"` literal in `src/node/services/workflows/WorkflowRunner.ts` with the canonical `isWorkflowRunTaskId()` predicate from `src/node/services/tools/taskId.ts` (after coder#3565). - Removed a duplicated `"chat.jsonl"` literal in `src/node/services/analytics/etl.ts` by re-exporting `CHAT_FILE_NAME` from the canonical `src/common/constants/paths.ts` (after coder#3541). - Extracted a `harvestRecordTime` helper in `src/node/services/memoryConsolidationService.ts` so `findNewestHarvestRecord` and `pruneHarvestRecords` derive the `completedAt ?? startedAt` ordering key from one place (after coder#3558). </details> Auto-cleanup checkpoint: a7f047b --- _Generated with `mux` • Model: `anthropic:claude-opus-4-8` • Thinking: `xhigh` • Cost: `n/a`_ <!-- mux-attribution: model=anthropic:claude-opus-4-8 thinking=xhigh costs=n/a --> --------- Co-authored-by: mux-bot[bot] <264182336+mux-bot[bot]@users.noreply.github.com>
Summary
Centralizes scheduled workflow automations at the project level so automations survive workspace archive/delete lifecycles, while still supporting existing-workspace targets and fresh-workspace-per-run targets.
Background
Workspace-local scheduled workflows were tied to a specific workspace record. This made recurring automations fragile: removing the workspace could remove the automation too. Project-level schedules make recurring workflows a first-class project setting.
Implementation
lastRunStartedAt, so unarchiving keeps overdue automations due immediately.Validation
make typecheckbun test src/browser/components/AutomationModal/AutomationModal.test.tsx src/browser/components/ProjectAutomationsModal/ProjectAutomationsModal.test.tsx src/common/utils/workflowScheduleTarget.test.tsbun test src/node/services/workflows/WorkflowSchedulerService.test.ts src/node/orpc/router.test.ts src/node/services/serviceContainer.test.tsbun test src/browser/components/WorkspaceMenuBar/WorkspaceMenuBar.test.tsx src/browser/components/AutomationModal/AutomationModal.test.tsx src/browser/components/ProjectAutomationsModal/ProjectAutomationsModal.test.tsxbun test src/node/orpc/router.test.ts src/node/services/workflows/WorkflowSchedulerService.test.tsbun test src/node/services/workflows/WorkflowSchedulerService.test.ts src/node/services/workflows/WorkflowService.test.tsbun test src/node/services/serviceContainer.test.tsmake storybook-run CMD="make test-storybook"make testmake static-checkMUX_ESLINT_CONCURRENCY=1 make static-checkRisks
Moderate regression risk in workflow scheduling and workspace creation paths. The change touches scheduler dispatch semantics, workflow run status propagation, and project config persistence. Risk is mitigated by targeted scheduler/router/service tests, full unit tests, Storybook interaction tests, and static checks.
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$649.23