feat/include providers in dispatchers#3
feat/include providers in dispatchers#3GabrielDomiciano wants to merge 6 commits intontorga:mainfrom
Conversation
| - **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. |
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
skills/dispatch.md
Outdated
| | 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` | |
There was a problem hiding this comment.
Why 5.2 for tier-2? https://developers.openai.com/codex/models
It seems to be a model listed as previous gen.
There was a problem hiding this comment.
This model went unnoticed; I switched to the recommended models as per the official documentation.
Commit dab5dbe
skills/dispatch.md
Outdated
| | ----------- | ---------------- | -------------- | ------------------------------------ | -------------------------------- | -------------------------------- | | ||
| | 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` | |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Interesting, which one doesn't support stdin?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
skills/dispatch.md
Outdated
| - **`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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
Two more things across the PR:
|
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.mdwith an entry for these changes.