Skip to content

[codex] feat(cli): add built-in subagents#12012

Open
yzlu0917 wants to merge 1 commit intocontinuedev:mainfrom
yzlu0917:codex/issue-9550-built-in-subagents
Open

[codex] feat(cli): add built-in subagents#12012
yzlu0917 wants to merge 1 commit intocontinuedev:mainfrom
yzlu0917:codex/issue-9550-built-in-subagents

Conversation

@yzlu0917
Copy link
Copy Markdown

@yzlu0917 yzlu0917 commented Apr 3, 2026

Summary

  • add built-in CLI subagents that are available without extra config.yaml setup
  • fall back to built-in planner, researcher, and reviewer subagents when no explicit subagent models are configured
  • keep configured subagent models taking precedence over the built-in defaults
  • cover the fallback and precedence behavior with ModelService regression tests

Why

The beta subagent tool already exists in the CLI, but trying it currently requires internal-only subagent model configuration. This change makes the feature usable out of the box by cloning the current chat model into a few specialized built-in subagents with hard-coded prompts in extensions/cli.

Validation

  • ran npm test -- src/services/ModelService.test.ts src/tools/subagent.test.ts
  • ran npm run lint in extensions/cli (passes with two existing repo warnings in unrelated files)

Closes #9550


Summary by cubic

Adds built-in CLI subagents (planner, researcher, reviewer) so the beta Subagent tool works out of the box and still honors explicitly configured subagent models (closes #9550). Each built-in clones the current chat model with a specialized prompt.

  • New Features

    • Added built-in agent definitions and prompts; CLI help text mentions them.
    • ModelService.getSubagentModels prefers configured subagents; otherwise falls back to built-ins cloned from the active chat model.
    • Tests cover precedence, fallback, and the no-base-model case.
  • Bug Fixes

    • Hardened subagent lookup and preview to handle missing model names.

Written for commit 4ec8449. Summary will update on new commits.

@yzlu0917 yzlu0917 marked this pull request as ready for review April 3, 2026 05:30
@yzlu0917 yzlu0917 requested a review from a team as a code owner April 3, 2026 05:30
@yzlu0917 yzlu0917 requested review from sestinj and removed request for a team April 3, 2026 05:30
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 3, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

if (options.workspaceDirectory) {

P2 Badge Apply workspace filter even for empty workspace keys

The new workspace filter is guarded by a truthy check, so passing workspaceDirectory: "" (the value used for sessions created without a workspace) skips filtering and returns all sessions instead of only no-workspace sessions. This makes history scoping incorrect in no-folder contexts and can surface unrelated project sessions when callers pass the current workspace value directly. Check for undefined/null rather than truthiness before filtering.

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

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Add built-in subagents

1 participant