Skip to content

🤖 refactor: remove plan subagent auto-handoff#3033

Open
ammar-agent wants to merge 1 commit intomainfrom
refactor/remove-plan-subagent-auto-handoff
Open

🤖 refactor: remove plan subagent auto-handoff#3033
ammar-agent wants to merge 1 commit intomainfrom
refactor/remove-plan-subagent-auto-handoff

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Remove plan-mode subagent auto-handoff after propose_plan, along with the executor-routing settings and backend router that supported it.

Background

Plan auto-handoff originally let plan-mode subagents compact into a plan and continue under exec or orchestrator. In practice it now collides with grouped task workflows: planning-only best-of batches can silently turn into implementation work. Removing the feature restores a clearer boundary: planning stays top-level, and task subagents stay implementation-oriented.

Implementation

  • removed the taskService stream-end handoff path that compacted history, switched agents, and posted synthetic Implement the plan / orchestrator kickoff messages
  • removed the plan-to-executor routing config surface from task settings, the settings UI, and the dedicated router/status modules
  • made the built-in plan agent non-runnable as a subagent again and added a task creation guard that rejects any plan-like subagent, including custom agents that inherit from plan
  • deleted the obsolete plan auto-routing story and updated orchestrator/docs copy to direct complex planning back to top-level plan workspaces instead of subagent auto-handoff

Validation

  • bun test src/common/types/tasks.test.ts
  • bun test src/node/services/taskService.test.ts
  • make static-check

Risks

Low-to-moderate. This intentionally removes an existing subagent workflow, so users relying on plan subagents that automatically continue into implementation will need to do planning in a top-level workspace instead. The change reduces surprising execution fan-out, and the new creation-time rejection keeps custom plan-like subagents from falling into an unsupported half-working state.


Generated with mux • Model: openai:gpt-5.4 • Thinking: high • Cost: $2.78

@ammar-agent
Copy link
Collaborator Author

@codex review

@ammar-agent
Copy link
Collaborator Author

@codex review

@ammar-agent
Copy link
Collaborator Author

@codex review

@ammar-agent
Copy link
Collaborator Author

@codex review

@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f8068019b

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

@ammar-agent
Copy link
Collaborator Author

@codex review

Please take another look.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if (status !== "awaiting_report") {
await this.setTaskStatus(workspaceId, "awaiting_report");
}
await this.promptTaskForRequiredCompletionTool(workspaceId, { reason: "stream_end" });

P1 Badge Treat successful propose_plan as terminal task completion

This path now always pushes plan-like tasks into awaiting_report recovery without first checking whether event.parts already contains a successful propose_plan result, so legacy/in-flight plan-like subagent tasks (e.g. after upgrading with existing tasks) can get stuck in a loop where they are repeatedly told to call propose_plan and never finalize or clean up. Before this change, a successful propose_plan stream-end had a dedicated terminal path; removing it without a replacement leaves affected tasks non-terminating.

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

@ammar-agent
Copy link
Collaborator Author

@codex review

Please take another look.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4709f2c0a5

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

@ammar-agent ammar-agent force-pushed the refactor/remove-plan-subagent-auto-handoff branch from 4709f2c to e3dcf9d Compare March 19, 2026 15:54
@ammar-agent
Copy link
Collaborator Author

@codex review

Please take another look.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3dcf9da6c

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

@ammar-agent
Copy link
Collaborator Author

@codex review

Please take another look.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56f491a3de

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

@ammar-agent
Copy link
Collaborator Author

@codex review

Please take another look.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

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

Remove plan-mode subagent auto-handoff after propose_plan, drop the executor-routing settings and backend router, reject plan-like task creation, and update related docs/stories/tests. --- _Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `high` • Cost: `$2.78`_ <!-- mux-attribution: model=openai:gpt-5.4 thinking=high costs=2.78 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

Please take another look.

@chatgpt-codex-connector
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant