@galaxy9day/executor-adapter 0.10.2 → 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-codex" # optional; omit the section to use the codex CLI default model
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 (or codex model name) directly per call:
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(model="gpt-5.5-codex", executor="codex", ...)
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
 
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.2'; // keep in sync with package.json
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.2",
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",
@@ -42,6 +42,9 @@ main orchestrator context. Dispatch only when the task is ready and bounded.
42
42
  - Use `mode="implement"`, `executor="codex"`, and
43
43
  `execution_mode="worktree"` unless the main session explicitly asks for a
44
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`.
45
48
  - Provide an explicit `scope` naming the files, directories, or behavior the
46
49
  executor may change, and cheap `validation_commands` when the project has
47
50
  fast checks.