@galaxy9day/executor-adapter 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -74,19 +74,22 @@ reviewer = "anthropic/claude-opus-4-7" # pi executor, mode=check / cross-mode
|
|
|
74
74
|
# fast = "newapi/gpt-5-mini"
|
|
75
75
|
|
|
76
76
|
[executor_adapter.codex]
|
|
77
|
-
implementer = "gpt-5.5
|
|
77
|
+
implementer = "gpt-5.5" # optional; omit the section to use the codex CLI default model
|
|
78
78
|
reviewer = "gpt-5.5"
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
Without this config, pi-executor calls without a fully-qualified `model` parameter throw a friendly error pointing you here. The codex executor never requires config: with no `[executor_adapter.codex]` entry and no `model` parameter it omits `-m` and uses the codex CLI's own configured default model.
|
|
82
82
|
|
|
83
|
-
You can also pass a fully-qualified Pi route
|
|
83
|
+
You can also pass a fully-qualified Pi route or exact Codex model id directly per call:
|
|
84
84
|
|
|
85
85
|
```
|
|
86
86
|
dispatch(model="anthropic/claude-opus-4-7", executor="pi", ...)
|
|
87
|
-
dispatch(
|
|
87
|
+
dispatch(executor="codex", ...) # use this machine's Codex default
|
|
88
|
+
dispatch(model="gpt-5.5", executor="codex", ...) # explicit Codex model id
|
|
88
89
|
```
|
|
89
90
|
|
|
91
|
+
Do not pass `model="codex"`: `codex` is the executor backend name, not a model.
|
|
92
|
+
|
|
90
93
|
## Executors
|
|
91
94
|
|
|
92
95
|
Two backends share the same dispatch pipeline (worktree isolation, diff export, post-validation, result classes, channel audit):
|
|
@@ -116,7 +119,7 @@ Assemble context, run the selected executor, optionally emit channel events, run
|
|
|
116
119
|
| `task_dir` | string | Trellis task directory (relative to repo). Omit to auto-resolve via `task.py current`. |
|
|
117
120
|
| `working_directory` | string | Repo root; defaults to CWD. |
|
|
118
121
|
| `executor` | `pi` \| `codex` | Executor backend. Defaults: `default_executor` config, else `implement/custom→codex`, `check→pi`. |
|
|
119
|
-
| `model` | string | Logical name (`implementer` / `reviewer` / custom key; `[executor_adapter.codex]` for codex) or fully qualified route/model name. |
|
|
122
|
+
| `model` | string | Logical name (`implementer` / `reviewer` / custom key; `[executor_adapter.codex]` for codex) or fully qualified route/model name. For Codex, omit it to use `$CODEX_HOME/config.toml`; never use `model="codex"`. |
|
|
120
123
|
| `thinking` | string | Reasoning effort. Default `xhigh` (`--thinking` for pi, `model_reasoning_effort` for codex). |
|
|
121
124
|
| `execution_mode` | string | `review`, `patch`, `worktree`, or `direct`. Defaults to `worktree` for `implement/custom`, `review` for `check`. |
|
|
122
125
|
| `isolate_executor` / `isolate_pi` | boolean | Default `true`. `isolate_executor` is the preferred name; `isolate_pi` remains as a compatibility alias. Pi: disables extensions/skills/prompt templates/context files/session persistence and uses a per-worker Pi home. Codex: `--ignore-rules --ephemeral` while still loading user config for provider/auth settings. |
|
|
@@ -188,7 +191,7 @@ Same args as `dispatch` (subset). Renders the prompt without launching an execut
|
|
|
188
191
|
|
|
189
192
|
### `smoke({ model?, mode?, executor? })`
|
|
190
193
|
|
|
191
|
-
One-shot connectivity test. Verifies the executor binary is on PATH and the resolved model answers a trivial round-trip. `model` accepts either a logical name or a fully qualified route/model name, `mode` (`implement` or `check`) chooses the default logical key when `model` is omitted, and `executor` follows the same routing defaults as `dispatch`. On failure it prints separate stdout and stderr blocks, the resolved model, safe env values, and (pi) the config files copied into the isolated Pi home.
|
|
194
|
+
One-shot connectivity test. Verifies the executor binary is on PATH and the resolved model answers a trivial round-trip. `model` accepts either a logical name or a fully qualified route/model name, `mode` (`implement` or `check`) chooses the default logical key when `model` is omitted, and `executor` follows the same routing defaults as `dispatch`. For Codex, `model="codex"` is rejected for the same reason as `dispatch`. On failure it prints separate stdout and stderr blocks, the resolved model, safe env values, and (pi) the config files copied into the isolated Pi home.
|
|
192
195
|
|
|
193
196
|
### `read_report({ log_file?, report_file?, runtime_dir?, worker_id?, lines? })`
|
|
194
197
|
|
|
@@ -246,7 +249,7 @@ Task(subagent_type="trellis-pi-check")
|
|
|
246
249
|
|
|
247
250
|
This keeps long dispatch output out of the main context. The sub-agent receives the MCP result, reads reports only when needed, and returns a short summary to the orchestrator.
|
|
248
251
|
|
|
249
|
-
Use `trellis-codex-implement` for the normal GPT implementation path. Use `trellis-pi-implement` only when you explicitly want Pi provider routing for implementation, and `trellis-pi-check` for read-only cross-model review. The Codex template omits `model` so `codex exec` uses this machine's Codex default from `$CODEX_HOME/config.toml`; the Pi templates resolve logical routes from `~/.pi/config.toml`.
|
|
252
|
+
Use `trellis-codex-implement` for the normal GPT implementation path. Use `trellis-pi-implement` only when you explicitly want Pi provider routing for implementation, and `trellis-pi-check` for read-only cross-model review. The templates set `effort: xhigh` for the Claude Code sub-agent itself; the MCP `thinking` parameter separately defaults to `xhigh` for the Codex/Pi executor it launches. The Codex template omits `model` so `codex exec` uses this machine's Codex default from `$CODEX_HOME/config.toml`; the Pi templates resolve logical routes from `~/.pi/config.toml`.
|
|
250
253
|
|
|
251
254
|
No Trellis `inject-subagent-context` hook edit is required. `dispatch` assembles Trellis task context itself from the task artifacts (`prd.md`, `design.md`, `implement.md`, `implement.jsonl`, and `check.jsonl` where applicable). For Codex/Pi/other platforms, translate these templates to the platform's native custom-agent syntax; do not put MCP tool names in `.trellis/agents/*.md`, because those files are provider-level channel runtime prompts, not MCP-capability declarations.
|
|
252
255
|
|
package/executors.js
CHANGED
|
@@ -90,8 +90,18 @@ export class ModelResolutionError extends Error {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
export class InvalidCodexModelError extends Error {
|
|
94
|
+
constructor(model) {
|
|
95
|
+
super(`Invalid Codex model "${model}": "codex" is the executor backend name, not a model. Use executor="codex" and omit model to use the Codex CLI default from $CODEX_HOME/config.toml, or pass a real Codex model id such as model="gpt-5.5".`);
|
|
96
|
+
this.code = 'INVALID_CODEX_MODEL';
|
|
97
|
+
this.model = model;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
93
101
|
// ---- Shared subprocess helpers ----
|
|
94
102
|
|
|
103
|
+
const CODEX_BACKEND_ALIASES = new Set(['codex', 'pi', 'executor-adapter', 'pi-adapter']);
|
|
104
|
+
|
|
95
105
|
// Explicit env override is authoritative: a configured-but-missing path is an
|
|
96
106
|
// error, not a trigger for silent PATH fallback.
|
|
97
107
|
function makeBinaryFinder(envVar, command) {
|
|
@@ -239,6 +249,10 @@ const codex = {
|
|
|
239
249
|
const defaultKey = mode === 'check' ? 'reviewer' : 'implementer';
|
|
240
250
|
const map = loadAdapterConfig().codex;
|
|
241
251
|
const logicalKey = input || defaultKey;
|
|
252
|
+
if (input) {
|
|
253
|
+
const normalized = String(input).trim().toLowerCase();
|
|
254
|
+
if (CODEX_BACKEND_ALIASES.has(normalized)) throw new InvalidCodexModelError(input);
|
|
255
|
+
}
|
|
242
256
|
if (map[logicalKey]) return { resolved: map[logicalKey], from: 'config', key: logicalKey };
|
|
243
257
|
if (input) return { resolved: input, from: 'direct', key: null };
|
|
244
258
|
// No config and no explicit model: defer to the codex CLI's own
|
package/index.js
CHANGED
|
@@ -45,7 +45,7 @@ import { EXECUTORS, resolveExecutor } from './executors.js';
|
|
|
45
45
|
|
|
46
46
|
const SERVER_NAME = 'executor-adapter';
|
|
47
47
|
const LEGACY_SERVER_NAMES = ['pi-adapter'];
|
|
48
|
-
const SERVER_VERSION = '0.10.
|
|
48
|
+
const SERVER_VERSION = '0.10.3'; // keep in sync with package.json
|
|
49
49
|
const TMP_RUNTIME_DIR = path.join(os.tmpdir(), SERVER_NAME);
|
|
50
50
|
const CHANNEL_ENV_ALIASES = ['TRELLIS_CHANNEL', 'TRELLIS_CHANNEL_NAME'];
|
|
51
51
|
const TRELLIS_BIN_ENV = 'TRELLIS_BINARY';
|
|
@@ -1725,7 +1725,7 @@ const TOOLS = [
|
|
|
1725
1725
|
task_dir: { type: 'string', description: 'Explicit Trellis task directory (relative to repo root). Omit to auto-resolve.' },
|
|
1726
1726
|
working_directory: { type: 'string', description: 'Repo root. Defaults to cwd.' },
|
|
1727
1727
|
executor: { type: 'string', enum: ['pi', 'codex'], description: 'Executor backend. Defaults: [executor_adapter] default_executor in ~/.pi/config.toml, else implement/custom→codex, check→pi.' },
|
|
1728
|
-
model: { type: 'string', description: 'Logical name (implementer / reviewer / custom key from ~/.pi/config.toml [executor_adapter], or [executor_adapter.codex] for codex) or a fully qualified route/model name. Omit to use the default for the mode (codex falls back to the codex CLI default model).' },
|
|
1728
|
+
model: { type: 'string', description: 'Logical name (implementer / reviewer / custom key from ~/.pi/config.toml [executor_adapter], or [executor_adapter.codex] for codex) or a fully qualified route/model name. Omit to use the default for the mode (codex falls back to the codex CLI default model). For the Codex backend, use executor="codex"; do not pass model="codex".' },
|
|
1729
1729
|
thinking: { type: 'string', default: 'xhigh' },
|
|
1730
1730
|
execution_mode: { type: 'string', enum: ['review', 'patch', 'worktree', 'direct'], description: 'review=read-only report, patch=final-answer diff, worktree=isolated git worktree + exported diff.patch, direct=legacy in-place execution. Defaults to worktree for implement/custom and review for check.' },
|
|
1731
1731
|
isolate_executor: { type: 'boolean', default: true, description: 'Preferred isolation flag. When true, Pi gets --no-extensions/--no-skills/etc. plus a per-worker PI_CODING_AGENT_DIR; codex gets --ignore-rules --ephemeral while still loading user config for provider/auth settings.' },
|
|
@@ -1772,7 +1772,7 @@ const TOOLS = [
|
|
|
1772
1772
|
inputSchema: {
|
|
1773
1773
|
type: 'object',
|
|
1774
1774
|
properties: {
|
|
1775
|
-
model: { type: 'string', description: 'Logical name or fully qualified route/model name.' },
|
|
1775
|
+
model: { type: 'string', description: 'Logical name or fully qualified route/model name. For the Codex backend, use executor="codex"; do not pass model="codex".' },
|
|
1776
1776
|
mode: { type: 'string', enum: ['implement', 'check'], default: 'implement', description: 'Default logical key to resolve when model is omitted.' },
|
|
1777
1777
|
executor: { type: 'string', enum: ['pi', 'codex'], description: 'Executor backend. Defaults: [executor_adapter] default_executor, else implement→codex, check→pi.' },
|
|
1778
1778
|
working_directory: { type: 'string' },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galaxy9day/executor-adapter",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Multi-executor MCP (Codex CLI for GPT implementation, Pi CLI for cross-model review) for Trellis-aware and standalone use. Reads Trellis task artifacts, runs the executor in an isolated subprocess/worktree, and can optionally emit non-invasive Trellis channel audit messages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -5,6 +5,7 @@ description: >-
|
|
|
5
5
|
executor via executor-adapter in an isolated worktree, returning only a short
|
|
6
6
|
summary with result_class, changed files, and apply command. Use this as the
|
|
7
7
|
normal GPT implementation path for Trellis tasks.
|
|
8
|
+
effort: xhigh
|
|
8
9
|
tools: mcp__executor-adapter__dispatch, mcp__executor-adapter__preview_prompt, mcp__executor-adapter__read_report, mcp__executor-adapter__smoke, Read, Grep, Glob, Bash
|
|
9
10
|
---
|
|
10
11
|
|
|
@@ -41,6 +42,9 @@ main orchestrator context. Dispatch only when the task is ready and bounded.
|
|
|
41
42
|
- Use `mode="implement"`, `executor="codex"`, and
|
|
42
43
|
`execution_mode="worktree"` unless the main session explicitly asks for a
|
|
43
44
|
different safe mode.
|
|
45
|
+
- Do not set `model="codex"`; `codex` is the executor backend name. Omit
|
|
46
|
+
`model` unless the main session gives an exact Codex model id such as
|
|
47
|
+
`gpt-5.5`.
|
|
44
48
|
- Provide an explicit `scope` naming the files, directories, or behavior the
|
|
45
49
|
executor may change, and cheap `validation_commands` when the project has
|
|
46
50
|
fast checks.
|
|
@@ -4,6 +4,7 @@ description: >-
|
|
|
4
4
|
Cross-model code review via the Pi reviewer model through executor-adapter; read-only;
|
|
5
5
|
supplements, but does not replace, the orchestrator's own verification and
|
|
6
6
|
native trellis-check. Returns severity-graded findings only.
|
|
7
|
+
effort: xhigh
|
|
7
8
|
tools: mcp__executor-adapter__dispatch, mcp__executor-adapter__read_report, Read, Grep, Glob, Bash
|
|
8
9
|
---
|
|
9
10
|
|
|
@@ -4,6 +4,7 @@ description: >-
|
|
|
4
4
|
Dispatch mechanical, well-specified implementation tasks to the Pi executor via
|
|
5
5
|
the executor-adapter MCP only when provider routing outside Codex is explicitly
|
|
6
6
|
needed. For normal GPT implementation, use trellis-codex-implement instead.
|
|
7
|
+
effort: xhigh
|
|
7
8
|
tools: mcp__executor-adapter__dispatch, mcp__executor-adapter__preview_prompt, mcp__executor-adapter__read_report, mcp__executor-adapter__smoke, Read, Grep, Glob, Bash
|
|
8
9
|
---
|
|
9
10
|
|