From 28df8bfa176ac71aca67d1c96b5fc59dd6fd116f Mon Sep 17 00:00:00 2001 From: lex Date: Mon, 10 Aug 2026 11:53:36 +0800 Subject: [PATCH] test(dag): align command routing contracts --- packages/core/src/plugin/command/dag-flow.txt | 2 +- packages/opencode/test/command/command.test.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/core/src/plugin/command/dag-flow.txt b/packages/core/src/plugin/command/dag-flow.txt index d5edd9bd4..301efd746 100644 --- a/packages/core/src/plugin/command/dag-flow.txt +++ b/packages/core/src/plugin/command/dag-flow.txt @@ -4,7 +4,7 @@ $ARGUMENTS -If the task is empty, ask for it and do not start a workflow. Otherwise load +If the task is empty or contains only whitespace, ask for it and do not start a workflow. Otherwise load the `orchestration-router` skill and route the request through one consolidated graph. `/dag-flow` explicitly selects DAG execution, but it does not waive a material user decision. diff --git a/packages/opencode/test/command/command.test.ts b/packages/opencode/test/command/command.test.ts index c0998f6e9..160937d0a 100644 --- a/packages/opencode/test/command/command.test.ts +++ b/packages/opencode/test/command/command.test.ts @@ -97,23 +97,23 @@ describe("legacy command registry", () => { const expanded = SessionPrompt.expandCommandTemplate(CommandPlugin.DagFlowContent, "Run two parallel workers") expect(expanded).toContain("Do not poll") - expect(expanded).toContain("End the current response") + expect(expanded).toContain("and end the response") }), ) - it.effect("requires profile-aware compilation without dropping task constraints", () => + it.effect("requires router-driven compilation without dropping task constraints", () => Effect.sync(() => { const expanded = SessionPrompt.expandCommandTemplate( CommandPlugin.DagFlowContent, "Use @security-reviewer to review this project. Do not modify files.", ) - expect(expanded).toContain("classify the task as `brainstorm`, `review`, or `develop`") - expect(expanded).toContain("preserve every user constraint") - expect(expanded).toContain("eligible configured worker types") - expect(expanded).toContain("Do not invent a missing role or model") - expect(expanded).toContain("actual error") - expect(expanded).toContain("must actually contain the requested synthesis") + expect(expanded).toContain("orchestration-router") + expect(expanded).toMatch(/Preserve\s+the task, user constraints/) + expect(expanded).toContain("worker types or model IDs") + expect(expanded).toContain("configured capability or model") + expect(expanded).toContain("real error") + expect(expanded).toContain("final synthesis block must contain the requested result") }), ) @@ -123,7 +123,7 @@ describe("legacy command registry", () => { expect(expanded).toContain("\n \n") expect(expanded).toContain("empty or contains only whitespace") - expect(expanded).toContain("Do not call the `workflow` tool") + expect(expanded).toContain("do not start a workflow") }), ) })