Skip to content

feat/include providers in dispatchers#3

Open
GabrielDomiciano wants to merge 6 commits intontorga:mainfrom
GabrielDomiciano:feat/include-providers
Open

feat/include providers in dispatchers#3
GabrielDomiciano wants to merge 6 commits intontorga:mainfrom
GabrielDomiciano:feat/include-providers

Conversation

@GabrielDomiciano
Copy link
Copy Markdown

@GabrielDomiciano GabrielDomiciano commented Mar 26, 2026

Summary

This PR adds Codex and Cursor to the dispatch skill (skills/dispatch.md) so routing and CLI guidance cover those providers explicitly.

It also updates .agents/CHANGELOG.md with an entry for these changes.

Comment on lines -35 to +37
- **Native dispatch** — the provider's CLI matches the host runtime. Use the host's built-in subagent mechanism (e.g., Task tool for Claude Code). Do not shell out to the same tool's CLI.
- **CLI dispatch** — the provider's CLI does not match the host runtime. Shell out to the provider's CLI tool (see CLI Dispatch section).
- If the preferred provider's CLI is not installed or unreachable, fall back to native dispatch and record the deviation in session memory.
- **Native dispatch** — if the current host runtime can satisfy the target provider through its native subagent mechanism, use that path instead of shelling out. Examples: Claude Code Task tool, Codex subagent environment, Cursor's native agent/subagent flow.
- **CLI dispatch** — if the current host runtime cannot satisfy the target provider natively, shell out to the provider's external CLI tool (see CLI Dispatch section).
- If the preferred provider's external CLI is not installed or reachable, but the host can still satisfy the request natively, fall back to native dispatch and record the deviation in session memory.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@GabrielDomiciano The change in phrasing here was due to some issue you faced? Could you please elaborate? Using "ifs" will increase the cognitive burden and rely more on the judgment of the LLM than to straight tell it to match exactly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Without these instructions, the Codex agent attempted to communicate with the personas externally (via the shell) rather than by invoking sub-agents. Therefore, I decided to reinforce the use of native sub-agents whenever a persona triggers an agent from the same CLI.

If you prefer, I can remove these instructions that "highlight" the correct usage of sub-agents.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I understand the problem — Codex shelling out instead of staying native is a real issue. But the fix should not change the dispatch structure from deterministic matching to conditional reasoning. The original phrasing ("CLI matches host → native; CLI doesn't match → shell out") gives the LLM a straight lookup. The new "if the current host runtime can satisfy" requires it to judge what "can satisfy" means, which is exactly the cognitive burden I want to avoid.

Instead, please keep the original step 4 structure intact and just add Codex/Cursor as examples in the parenthetical — the same way step 1 already does. That reinforces the native path for those providers without introducing branching.

| Provider | `preferredModel` | CLI | tier-1 | tier-2 | tier-3 |
| ----------- | ---------------- | -------------- | ------------------------------------ | -------------------------------- | -------------------------------- |
| Claude Code | `claude` | `claude` | Haiku | Sonnet | Opus |
| Codex CLI | `codex` | `codex` | `gpt-5.4-mini` | `gpt-5.2` | `gpt-5.4` |
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why 5.2 for tier-2? https://developers.openai.com/codex/models
It seems to be a model listed as previous gen.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This model went unnoticed; I switched to the recommended models as per the official documentation.

Commit dab5dbe

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the fix.

| ----------- | ---------------- | -------------- | ------------------------------------ | -------------------------------- | -------------------------------- |
| Claude Code | `claude` | `claude` | Haiku | Sonnet | Opus |
| Codex CLI | `codex` | `codex` | `gpt-5.4-mini` | `gpt-5.2` | `gpt-5.4` |
| Cursor CLI | `cursor` | `cursor-agent` | `auto` | `auto` | `claude-4.6-opus-max-thinking` |
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Interesting, why auto tho? Isn't it better to use like a free model or an in-house one like Composer 2 for those secondary levels?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The Cursor CLI continues to point to auto because it automatically detects the best available model for the credentials and limits of the specific installation. Forcing a specific model—such as Composer 2 or another “free” option—could break the workflow for team members who do not have that model enabled (or who have low usage limits), whereas leaving the value set to auto ensures that the framework remains functional in any Cursor environment.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The portability argument is fair, but then tier-3 specifies claude-4.6-opus-max-thinking explicitly — which has the same availability risk. If auto is the safe portable choice, it should be auto across all tiers. If concrete models are better for determinism, all tiers should name them. The current mix is inconsistent — please pick one direction and apply it uniformly.

## CLI Dispatch

When the host runtime differs from the target provider, pipe the assembled prompt through `stdin`:
When the host runtime differs from the target provider, dispatch using the provider's accepted input mode. Prefer `stdin` when the CLI supports it; otherwise pass the assembled prompt as a single non-interactive argument.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Interesting, which one doesn't support stdin?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That paragraph is included because the providers' CLIs accept input in different ways: Codex and Claude can run via stdin (cat … | codex exec - …), whereas the cursor-agent requires the prompt to be passed as a command-line argument.

Since the general dispatch logic must accommodate all providers, this behavior is explicitly noted to prevent users from sending a prompt via stdin to a CLI that does not support it—which would cause the command to simply hang. Keeping this explanation helps avoid confusion when using a mix of providers.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Good to know about cursor-agent not supporting stdin — that's genuinely useful info. But it belongs in the cursor-agent provider bullet under CLI Dispatch, not as a change to the general dispatch pattern. The general section intro should stay as "pipe the assembled prompt through stdin" since that's the default. Provider-specific deviations (like cursor-agent using a CLI argument instead) are what the per-provider bullets are for. Please revert the general intro and move the stdin caveat into the cursor-agent bullet.

Comment on lines +105 to +106
- **`codex`**: `exec - --model [model] --sandbox workspace-write --skip-git-repo-check -C [workspace]`. `exec -` reads the prompt from `stdin`. Use this only when Codex must be called externally by another host runtime; if the current host is already Codex and it supports subagents, stay native. Add `--full-auto` only when the environment already enforces the required safety boundaries.
- **`cursor-agent`**: `--print --trust --model [model] --workspace [workspace] "[assembled prompt]"`. Cursor CLI takes the prompt as an argument in headless mode; keep it non-interactive.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Care to explain why --skip-git-repo-check? You mention if the current host is Codex, stay native, but that's repeating the instruction provided earlier.

Also, cursor is using --print and --trust... doesn't that mean it will skip permissions check? Starter kit cannot have that kind of YOLO mode cause it's a foundational prompt framework, you know?

I think the idea of --workspace may also fall into the same idea that it's opinionated way of working. Some devs aren't even using git... yeah, I know.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Great callout. --skip-git-repo-check stays in the Codex external-dispatch command because this framework must work in directories that are not Git repos; without it, codex exec can fail before running the task. We validated this behavior directly in this workspace (non-git): without the flag, Codex returns a repo-check error.

You are also right about the redundancy: the “if current host is Codex, stay native” sentence did repeat routing logic already defined earlier. That part was removed from the Codex bullet so the section now only keeps command-specific instructions and rationale.

On Cursor, your concern about YOLO mode is valid. The default command was changed to a neutral/safe baseline: no --trust in the standard path. --trust is now explicitly opt-in only when safety controls are already enforced outside the CLI. We also removed hard dependency on --workspace; it is now optional and only used when explicitly provided by the caller, which avoids imposing one opinionated workflow (including on teams not using git). We tested both forms (cursor-agent with and without --workspace) and both worked correctly.

Commit 3cb4607

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Good changes across the board here. --skip-git-repo-check rationale is solid — starter kit must work in non-git dirs. Removing the redundant native routing sentence makes sense. The --trust and --workspace resolution is exactly right — opt-in only, no defaults that bypass safety.

One last thing: your PR creates version 0.3.2 in the CHANGELOG but that version was already taken by a commit on main. You'll need to rebase and bump to the next available version.

@GabrielDomiciano
Copy link
Copy Markdown
Author

@ntorga additionally, I created the changelog for the changes.

Commit 698b3b3

@ntorga
Copy link
Copy Markdown
Owner

ntorga commented Mar 27, 2026

Two more things across the PR:

  1. Conventional commits. This project follows Conventional Commits — the format is type(scope): description (colon, not slash). For example: feat(dispatch): add Codex and Cursor to provider routing, not feat/include providers in dispatchers. The PR title and all commit messages need to follow this. Same for the fix commits — fix(dispatch): update Codex tier-2 model instead of fix/models in provider codex.

  2. If you're unsure about the format, let your agent handle the commit message — most coding agents already follow conventional commits out of the box and will get the format right.

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.

2 participants