Repository navigation
Repo-versioned workflow definitions (WORKFLOW.md) (#164) - #1577
Conversation
A committed WORKFLOW.md (or .solenta/workflow.md) in the thread's checkout replaces the default template on workflow runs, validated with the store template rules; an invalid file fails the start instead of falling back. Explicitly picked store templates still win. The workflows editor gains Export to repo (workflows:exportToRepo, files web scope). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4566f3b188
ℹ️ 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".
| if (project.remoteHost || require("./wsl.js").wslTarget(project)) { | ||
| throw new Error("Export to repo is not supported for remote projects"); | ||
| } | ||
| const dir = thread.worktreePath || project.path; |
There was a problem hiding this comment.
Materialize pending worktrees before exporting
When the selected thread has pendingWorktree: true but no worktreePath (the normal state before its first run), this falls back to project.path and writes the workflow into the shared checkout. The first run then creates a separate worktree from committed Git state, so the exported uncommitted WORKFLOW.md is absent or stale there and the workflow is not used, while the project checkout is dirtied unexpectedly. Materialize the pending worktree before selecting the destination, or reject the export until it exists.
Useful? React with 👍 / 👎.
| if (fs.existsSync(file) && !(input && input.overwrite)) { | ||
| return { written: false, path: file }; | ||
| } | ||
| fs.mkdirSync(path.dirname(file), { recursive: true }); |
There was a problem hiding this comment.
Do not recreate a missing worktree as an empty directory
If a thread's worktree directory was deleted externally, exporting reaches this recursive mkdirSync and recreates only the directory, without restoring its Git worktree. Subsequent run setup sees that worktreePath exists, skips the existing missing-worktree recovery, and launches agents in an empty non-Git directory containing only the exported file. Check and rematerialize the worktree before writing rather than recreating a stale path.
Useful? React with 👍 / 👎.
| return { written: false, path: file }; | ||
| } | ||
| fs.mkdirSync(path.dirname(file), { recursive: true }); | ||
| fs.writeFileSync(file, repoWorkflow.serializeRepoWorkflow(template)); |
There was a problem hiding this comment.
Refuse to overwrite workflow symlinks
When an existing WORKFLOW.md or .solenta/workflow.md is a symbolic link, the confirmation reports the in-repo path, but this write follows the link and truncates its target. A checked-out repository can therefore point the workflow file outside the checkout and cause the second “Overwrite” click to destroy an arbitrary user file. Inspect the destination with lstat and refuse symlinks or open it with no-follow semantics.
Useful? React with 👍 / 👎.
Closes #164.
What
standard),startWorkflowRunreadsWORKFLOW.md(then.solenta/workflow.md) from the thread's own checkout, so the workflow versions with the branch. Explicitly picked store templates still win. The kickoff event notesfrom WORKFLOW.md.validateWorkflowTemplateas store templates; an invalid file fails the start with the file name prefixed (WORKFLOW.md: Phase "build": agentCount …), never a silent fallback.workflows:exportToRepo,filesweb scope). It refuses to clobber an existing file until a second Overwrite click; disabled while the draft has unsaved edits.Format (
electron/repoWorkflow.js)Unknown keys error; an instruction cannot contain its own
##line.Not in scope
Tests
electron/test/repo-workflow.test.js: round trip, file precedence, export + overwrite guard.electron/test/workflow.test.js: repo file beats default, explicit pick beats repo file, invalid file rejects.test/workflowsModal.test.tsx: export + overwrite confirm, hidden without a target.test:electron: 4506/4507; the one failure (webScopes classification of the new channel) is fixed in this commit and its file passes 10/10.vite buildOK.tscreports one error insrc/mermaidEngine.ts(trustedTypes typing), which this PR doesn't touch.🤖 Generated with Claude Code