🤖 feat: streamline workflow authoring#3575
Conversation
Adds opt-in workflow args metadata parsing, sandbox mux schema/util helpers, and built-in git review context/preflight actions.\n\n---\n\n_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `887858{MUX_COSTS_USD:-unknown}`_\n\n<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=26.32 -->
Moves workflow descriptions into metadata, adds generated built-in GitHub action sources, action SDK helpers, and mux patch/parallel helpers.\n\nValidation:\n- bun test src/node/services/workflows/WorkflowDefinitionStore.test.ts src/node/services/workflows/WorkflowService.test.ts src/node/services/workflows/WorkflowActionRunner.test.ts src/cli/workflow.test.ts src/cli/trust.test.ts --test-name-pattern "description|workflow args|parallel agent maps|SDK helpers|git reviewContext|starts a named workflow|workflow|trust"\n- make typecheck\n- make lint\n- make static-check\n\n---\n\n_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `1091508{MUX_COSTS_USD:-unknown}`_\n\n<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=36.17 -->
Preserve workflow metadata while promoting descriptions, track generated workflow action content, and reduce redundant Git/GitHub action work. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$56.31`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=56.31 -->
Move built-in Git workflow actions into generated action source files, consolidate GitHub helper calls, avoid an extra label refetch, and reuse the shared plain-object guard for workflow args.
Add static workflow metadata parsing for mux.schema helpers, extracted workflow runtime/action child sources, stronger built-in action schemas, and concise schema alias support across workflows/actions. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$181.71`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=181.71 -->
|
@codex review |
Ensure Jest/Windows test environments can import the generated workflow runtime source module without requiring local codegen first. --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$187.08`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=187.08 -->
|
@codex review Pushed a CI fix for the missing generated workflow runtime source module and re-ran local validation. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e30d5aacf
ℹ️ 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".
Fix deep-review findings around generated workflow bundle drift checks, workflow JS lint coverage, metadata stripping, schema alias ordering, nullable workflow args, quoted Windows paths, stale JSON schema union tests, and raw JS tsconfig inclusion. Validation: - env MUX_ESLINT_CONCURRENCY=1 make static-check - make build-main - bun test src/common/utils/jsonSchemaSubset.test.ts - bun test src/node/services/workflows/WorkflowActionRunner.test.ts --test-name-pattern "rejects schema aliases declared after action metadata|runs JavaScript actions out of process|describes every built-in action" - bun test src/node/services/workflows/WorkflowService.test.ts --test-name-pattern "normalizes quoted Windows paths|runs workflows with metadata strings|normalizes workflow args from static metadata" --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$190.19`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=190.19 -->
|
@codex review Ran |
Export GitHub action reconcile handlers as callable async declarations so static action discovery reports reconciliation support consistently with child execution. Validation: - env MUX_ESLINT_CONCURRENCY=1 make static-check - bun test src/node/services/workflows/WorkflowActionRunner.test.ts --test-name-pattern "describes every built-in workflow action" --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$190.19`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=190.19 -->
|
@codex review Addressed the reconcile export finding, replied inline, resolved the thread, and pushed the fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a04adfb23d
ℹ️ 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".
Mark read-only GitHub fetch/verify workflow actions as read effects so interrupted or failed attempts remain retryable without reconciliation. Validation: - env MUX_ESLINT_CONCURRENCY=1 make static-check - bun test src/node/services/workflows/WorkflowActionRunner.test.ts --test-name-pattern "describes every built-in workflow action" --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$190.19`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=190.19 -->
|
@codex review Addressed the read-only GitHub action effect finding, replied inline, resolved the thread, and pushed the fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67b90fdaf6
ℹ️ 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".
Keep legacy // description: workflow headers discoverable while supporting new static metadata declarations, and cover legacy project workflow listing/reading. Validation: - env MUX_ESLINT_CONCURRENCY=1 make static-check - bun test src/node/services/workflows/WorkflowDefinitionStore.test.ts --test-name-pattern "legacy description headers" --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$190.19`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=190.19 -->
|
@codex review Addressed the legacy workflow description header compatibility finding, replied inline, resolved the thread, and pushed the fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a945c2ff5
ℹ️ 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".
Mask regex literals in the workflow action child source before depth-counting export declarations so executable actions with regex literals before metadata/execute load consistently with static describe. Validation: - env MUX_ESLINT_CONCURRENCY=1 make static-check - bun test src/node/services/workflows/WorkflowActionRunner.test.ts --test-name-pattern "executes actions with regex literals before exports" --- _Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$190.19`_ <!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=190.19 -->
|
@codex review Addressed the action child regex masking finding, replied inline, resolved the thread, and pushed the fix. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e07a35291
ℹ️ 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 Pushed a unit-test-only follow-up for the CI failures: the parallelActions fixture now uses the tightened git.status input schema and the sandbox exposure expectation reflects the intentional mux helper global. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e95945c8a
ℹ️ 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".
|
Addressed the latest Codex findings:
Validation after fixes:
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac8292142d
ℹ️ 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".
b2d2f77 to
9125646
Compare
|
@codex review Please take another look after the CI-only split in 9125646. The previous review threads are resolved; this last push splits the QuickJS-heavy deep-review auto-fix unit filters into separate Bun processes after the Unit job hit the known mprotect/timeout failure in the grouped filter. |
9125646 to
d98f0a3
Compare
There was a problem hiding this comment.
💡 Codex Review
mux/src/node/services/workflows/builtInWorkflowActions.ts
Lines 92 to 95 in d98f0a3
When a repository contains .mux/security/.gitignore as a symlink, these reads/writes follow it after only the .mux/security directory was realpath-checked. Running security-scan on such a worktree can overwrite any user-writable symlink target with *\n before artifacts are written, escaping the promised workspace-local .mux/security boundary; use lstat/no-follow semantics or replace the symlink instead.
ℹ️ 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".
d98f0a3 to
b8f84e7
Compare
|
@codex review Please take another look after b8f84e7. This push only addresses the Unit CI flake by increasing the WorkflowRunner parallelWorkflows sibling-abort test guard from 500ms to 5s after the previous run timed out at the guard on CI. Targeted test and |
b8f84e7 to
8bedd32
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bedd32f92
ℹ️ 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".
8bedd32 to
067dd74
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 067dd74e47
ℹ️ 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".
067dd74 to
84de03c
Compare
|
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". |
|
@codex review Pushed a Dockerfile fix for the merge-queue-only Local validation:
|
|
Codex Review: Didn't find any major issues. Keep it up! 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
Streamlines durable workflow authoring by introducing static metadata parsing for workflow/action schemas, bundling runtime/action child JavaScript from lintable source files, and adding concise
const s = mux.schema;schema aliases across built-in workflows and actions.Background
Workflow definitions and actions were accumulating repeated handwritten schema objects and
mux.schema.*boilerplate. Runtime support code also lived as large inline strings, which made it harder to lint, format, and maintain.Implementation
mux.schema.*and top-level schema aliases such asconst s = mux.schema;, restricted to aliases declared before metadata so static discovery matches runtime evaluation.};, nullable workflow args, quoted Windows path args, and raw JS tsconfig inclusion.Validation
env MUX_ESLINT_CONCURRENCY=1 make static-checkmake build-mainenv TEST_INTEGRATION=1 bun x jest tests/ipc/runtime/executeBash.test.ts --runInBandbun test src/common/utils/jsonSchemaSubset.test.tsbun test src/node/services/workflows/WorkflowActionRunner.test.ts --test-name-pattern "rejects schema aliases declared after action metadata|runs JavaScript actions out of process|describes every built-in action"bun test src/node/services/workflows/WorkflowService.test.ts --test-name-pattern "normalizes quoted Windows paths|runs workflows with metadata strings|normalizes workflow args from static metadata"bun test src/node/services/workflows/builtInWorkflowDefinitions.test.ts --test-name-pattern "built-in workflows"deep-review-workflowand fixed the identified issues.simplifyworkflow successfully via CLI after rebasing onorigin/main.Risks
Moderate: this touches durable workflow discovery, metadata parsing, action execution, generated built-in workflow/action bundles, and validation infrastructure. The parser intentionally supports only static top-level schema aliases declared before metadata, not dynamic aliasing, to keep discovery deterministic and aligned with runtime execution order.
Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh• Cost:$190.19