Skip to content

[Feature]PlanOnly mode#203

Merged
JackChen-me merged 2 commits intoJackChen-me:mainfrom
CodingBangboo:planOnly_mode
May 4, 2026
Merged

[Feature]PlanOnly mode#203
JackChen-me merged 2 commits intoJackChen-me:mainfrom
CodingBangboo:planOnly_mode

Conversation

@CodingBangboo
Copy link
Copy Markdown
Contributor

What

Adds a planOnly option to runTeam() that lets the coordinator decompose a goal into tasks without executing any task agents. The result has success: true, planOnly: true, and tasks populated with pending/blocked task records: useful for integration testing the task DAG or previewing cost before a real run.

What changed

  • src/types.ts — new RunTeamOptions interface (replaces the inline anonymous options type on runTeam()); adds planOnly?: boolean to both RunTeamOptions and TeamRunResult
  • src/orchestrator/orchestrator.tsrunTeam() now accepts RunTeamOptions; bypasses the simple-goal short circuit when planOnly: true; inserts a short-circuit after onPlanReady fires (but before executeQueue) that returns success: true with tasks from queue.list()
  • src/index.ts — exports RunTeamOptions as part of the public API
  • tests/orchestrator.test.ts — four new test cases covering: plan returned without executing tasks, onPlanReady still fires, onPlanReady rejection wins over planOnly, and simple-goal short-circuit is bypassed

Behavior notes

  • onPlanReady still fires when planOnly: true. If the callback returns false, the rejection wins — result is success: false and planOnly is undefined (same as today's abort behavior).
  • planOnly is a per-call option on the third argument, not on OrchestratorConfig: consistent with the scope guidance in the issue.
  • The simple-goal short-circuit is bypassed so the coordinator always runs, which means planOnly on a single-agent team is valid and returns a single-task plan.

Why

fixed #192

@JackChen-me
Copy link
Copy Markdown
Owner

@codex review plz

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ 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".

@JackChen-me
Copy link
Copy Markdown
Owner

Approach looks right, but there is one real lifecycle bug.

P1 (must fix): agent_start fires for the coordinator before decomposition, but the new planOnly path returns before the matching agent_complete, which currently only fires after synthesis. Anyone tracking active agents via onProgress will see the coordinator as permanently running for successful plan-only runs. Small fix: emit agent_complete for the decomposition result before the planOnly return, and add a regression test that agent_start / agent_complete stay balanced.

P2 (optional, can be follow-up): renderLiveOutput in the dashboard treats only completed, failed, skipped, and blocked as terminal. In a plan-only result, root tasks intentionally remain pending, so the dashboard header says "Task graph execution in progress" instead of showing this as a completed plan preview. This is outside the main runTeam path, so I would not block on it, but it is worth fixing for callers who render plan-only results.

@CodingBangboo CodingBangboo marked this pull request as draft May 4, 2026 01:35
@CodingBangboo CodingBangboo marked this pull request as ready for review May 4, 2026 01:49
@JackChen-me
Copy link
Copy Markdown
Owner

P1 fixed. P2 is non-blocking / follow-up. Good to merge.

@JackChen-me JackChen-me merged commit 12bdac3 into JackChen-me:main May 4, 2026
4 checks passed
@CodingBangboo CodingBangboo deleted the planOnly_mode branch May 7, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] planOnly mode for runTeam() — inspect task decomposition without executing

2 participants