[codex] Add Go-authored custom workflows#677
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 69f050c3c6
ℹ️ 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 root == "" { | ||
| continue | ||
| } | ||
| return filepath.Join(root, skill, "workflows", req.Name), scope, nil |
There was a problem hiding this comment.
Reject traversal in skill-scoped workflow paths
When scope=skill, the raw skill value is joined into the filesystem path. A create_workflow call with a value such as ../../tmp/target escapes the configured skill root; with overwrite set, the later os.RemoveAll(dir) and writes can delete or create files outside the skill directory. Validate the skill name with the same kebab-case rule (or verify the cleaned path remains under root) before joining it.
Useful? React with 👍 / 👎.
| if req.Overwrite { | ||
| if err := os.RemoveAll(dir); err != nil { |
There was a problem hiding this comment.
Validate replacements before deleting the active bundle
For an existing workflow updated with overwrite=true, the old bundle is removed before the replacement source is built. If the new source fails to compile, CreateWorkflow returns an error but the previous on-disk bundle is already gone; because runSourceWorkflow rebuilds from bundle.Dir on each invocation, the previously registered workflow starts failing too. Build and validate in a temporary directory, then atomically swap it into place only after validation succeeds.
Useful? React with 👍 / 👎.
…rkflows # Conflicts: # cmd/harnesscli/tui/model_editor_test.go # docs/logs/long-term-thinking-log.md
…rkflows # Conflicts: # cmd/harnessd/bootstrap_helpers_test.go # docs/logs/long-term-thinking-log.md
Adds Go-authored workflow bundles with manifest discovery, compile validation, hot registration, and a workflow SDK for phase/log/feedback/question/subworkflow calls.
Wires
create_workflowandrun_workflowdeferred tools plus/v1/script-workflowsserver setup so agents and API clients can run workflows without restartingharnessd.Persists and streams structured workflow feedback so parent agents, API clients, and SSE replay can inspect intermediate progress and findings.
Also adds the requested AGENTS/CLAUDE communication note, a workflow implementation plan, and a small
ux-feedback-checkbundle used to validate workflow UX paths.Validation:
./scripts/test-regression.shpassed with coveragegate total 84.4%, and workflow UX was smoke-tested through direct API, tmux CLI withgpt-4.1-mini, and direct/v1/runsAPI.