Conversation
A workflow spec was a throwaway file the agent rewrote per run. Saving one under a name makes it a durable asset: `.opencode/workflows/<name>.yaml` for the project, `<config dir>/workflows/<name>.yaml` for every project, project shadowing global — the same two-level scope dag.jsonc already uses. - dag/workflows.ts resolves a name to its spec and lists the library. A path-shaped spec_path bypasses it, so existing calls behave identically. - The workflow tool gains `action: "list"`. A resolved name skips the external-directory prompt: both scopes are curated config at the same trust level as dag.jsonc, and only the library directories are reachable that way. isName rejects separators, YAML extensions, leading dots, and control characters, so nothing outside those directories resolves. - New built-in skill create-dag-workflow (registered in both the core V2 plugin and the opencode V1 registry) covers scope choice, the spec shape, the rules a saved spec must respect, and how to verify one. - .opencode/workflows/change-review.yaml ships as a working example, guarded by a test that decodes it against StartSpec and checks its template ids and dependency edges resolve. - README/README.zh: GraphAgent as the product name, a "Using workflows" guide, and the project configuration file inventory.
feat(dag): saved workflow library and create-dag-workflow skill
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes the saved workflow library (#156) from
devtomain.What ships
A DAG workflow spec used to be a throwaway file the agent rewrote on every run. It can now live under a name and be started by that name:
Project shadows global — the same two-level scope,
OPENCODE_CONFIG_DIRredirect, and lazy read thatdag.jsoncalready uses.packages/opencode/src/dag/workflows.ts(new) — name resolution and library listing.spec_pathaccepts a bare name;isNamerejects separators,.yaml/.ymlextensions, leading dots, and control characters, so every previously validspec_pathtakes the identical old branch. A resolved name skips the external-directory prompt (both scopes are curated config atdag.jsonc's trust level, and only those two directories are reachable that way). Newaction: "list"shows saved specs, not running workflows.create-dag-workflow— registered in both the core V2 plugin and the opencode V1 registry..opencode/workflows/change-review.yaml— a working example, guarded by a test that decodes it againstStartSpecand checks its template ids and dependency edges resolve.Verification on
devThe full suite ran on the
devmerge commit and is green: Unit Tests (linux), E2E Tests (linux), E2E Tests (windows), Typecheck, CodeQL.The first Windows E2E attempt failed in
Setup Bun → Install dependencies—tree-sitter-powershell's node-gyp install script exited 9 while fetching Node headers, before any test ran. This commit touches nopackage.json,bun.lock,patches/, or CI config, so it cannot be the cause; a rerun of the failed job passed.Locally: 348 dag/skill tests pass in
packages/opencode, 20 plugin tests inpackages/core, lint at 4710 (themainbaseline, no new warnings), and an L3 deep security review returned 0 findings.