agent-council 0.2.0 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 751f5a003739afdc2ba0e6abcd22f9707e79e728afe1e6f35e1a136c52702ad1
4
- data.tar.gz: 657e7acddaa861b9c4e7833dd04143c7ca9338e39dfbbe4e7d3b865e77c1ec0d
3
+ metadata.gz: 0c8c3369d6528881fa7a2e782c67616af27fc539c683f26310603895e9aa5e4e
4
+ data.tar.gz: 802074659af4258867342acc7574adadf72898754e190cfd334c356a350402eb
5
5
  SHA512:
6
- metadata.gz: 997f29373d301c1ca163544d77ae9326a70085ee843f98414b8348f486acfccb7395b892e6016b79d88f59e715f4f5a578ee4d1448d85fec59d2553a95d3a000
7
- data.tar.gz: dd10b7039737ded71e0b34f4efdf6aaa4e5ba11a5f8975d0bb7a6533d7eec7e6174fef947aaf58f316c22d08aef5c3e7540cc1f6f3f95ed15c8331182854c2a1
6
+ metadata.gz: 49fbc18a9df355114f4ebdd6edf044c9ed504cdc88292b5ebea4b90903945aff5ff9555fb3e7c81d4c7813a970a2251d0319d1ffeb9effe209d66e9ea1f720d7
7
+ data.tar.gz: 401eb7b6e0758627f3da90d0c870eedd13a15067662de26fe0c653d84548196168f50dd597d3ed46411d9d18cbc010957d860e55f442d29de58236a5f48469d4
data/DESIGN.md CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
  The long-term goal is to collect genuinely different viewpoints on the same question from multiple harness/model instances, and, because every instance gets the identical task, to compare those instances against each other on speed, token usage, cost, and quality.
6
6
 
7
- This repository is the first step: it varies the models and, per agent, the harness, which is Pi (for any provider's models) or Claude Code (for Anthropic's). More harnesses may follow (§18).
7
+ This repository is the first step: it varies the models and, per agent, the harness, which is Pi (for any provider's models), Claude Code (for Anthropic's), or Codex (for OpenAI's). More harnesses may follow (§18).
8
8
 
9
9
  It is packaged as a gem for easy installation, but it is intentionally not a general-purpose framework.
10
10
 
11
- agent-council is a small Ruby CLI that runs the **same prompt** through several AI harness/provider/model combinations, under the Pi or Claude Code coding-agent harness, and saves each final response to a deterministic Markdown file.
11
+ agent-council is a small Ruby CLI that runs the **same prompt** through several AI harness/provider/model combinations, under the Pi, Claude Code, or Codex coding-agent harness, and saves each final response to a deterministic Markdown file.
12
12
 
13
13
  The objective is utility, not completeness. Given a config (§5), one command:
14
14
 
@@ -62,7 +62,7 @@ For example:
62
62
 
63
63
  ## 4. Architecture
64
64
 
65
- There are two harnesses, pi and Claude Code, and the orchestration is harness-agnostic: it looks up each agent's harness module by its config entry's `harness` key (§5) in `AgentCouncil::Harnesses::BY_NAME` (`lib/agent_council/harnesses.rb`), so another harness is another such module, added there. Every config entry names its harness (§5); reports and `run.json` entries always record theirs, and one that gives none (hand-edited, or older than 0.1.0, when every agent ran under pi) is read as pi's. Each module is a plain namespace with the same functions (`NAME`, `argv`, `usage`, `error_message`, `exit_detail`, `warnings`, `final_response`, `assistant_messages`); `NAME` is both the config value and the executable that `argv` runs, which the startup check looks for on `PATH`, and goes into filenames unsanitized, so it must be filename-safe. Claude Code takes no provider argument, so a Claude Code entry's provider only labels the agent. The scaffolding text (§10) is shared.
65
+ There are three harnesses, pi, Claude Code, and Codex, and the orchestration is harness-agnostic: it looks up each agent's harness module by its config entry's `harness` key (§5) in `AgentCouncil::Harnesses::BY_NAME` (`lib/agent_council/harnesses.rb`), so another harness is another such module, added there. Every config entry names its harness (§5); reports and `run.json` entries always record theirs, and one that gives none (hand-edited, or older than 0.1.0, when every agent ran under pi) is read as pi's. Each module is a plain namespace with the same functions (`NAME`, `argv`, `usage`, `error_message`, `exit_detail`, `warnings`, `final_response`, `assistant_messages`); `NAME` is both the config value and the executable that `argv` runs, which the startup check looks for on `PATH`, and goes into filenames unsanitized, so it must be filename-safe. Claude Code and Codex take no provider argument, so their entries' provider only labels the agent. The scaffolding text (§10) is shared.
66
66
 
67
67
  **Labels.** The short labels (`#1 provider / model`) don't show the harness. They appear in progress lines, result tables, the consolidation prompt, and a consolidated report's `### Sources` table and `sources` front matter. The startup agent list, each report's byline table, and the findings file's legend (`#1 pi / provider / model`) do show it. Short labels don't need the harness to stay unique: the only ones used as lookup keys are the analysts', which match reports to their `run.json` entries and to the configured agents, and each carries its agent number. Nor does the consolidator need it in the labels, since each report it reads states its harness in its byline (§12). So they stay as they are, and a mixed run's output reads the same as before.
68
68
 
@@ -74,7 +74,7 @@ Ruby CLI
74
74
  +-- Pi + model A
75
75
  +-- Pi + model B
76
76
  +-- Claude Code + model C
77
- +-- Claude Code + model D
77
+ +-- Codex + model D
78
78
  ```
79
79
 
80
80
  ---
@@ -113,9 +113,9 @@ consolidator: # optional; synthesizes the agents' reports (§12)
113
113
  model: MODEL_ID_HERE
114
114
  ```
115
115
 
116
- Every entry gives `harness`, `provider`, and `model`, each a nonblank string; there are no defaults, and no `defaults:` section supplying them (one was considered and rejected). A default harness or provider would go stale as harnesses change (pi is the right default only as long as it is), and a `defaults:` section's provider would apply across harnesses whose providers differ. `harness` is `pi` or `claude`; an unknown one is rejected at startup (with `--consolidate`, only the consolidator's, since no analysts run). A `claude` entry's provider is not passed to Claude Code (§4) and only labels the agent (e.g. `bedrock`, for a `claude` set up to use it). A config error lists every bad entry, each named by its key (`'agents' entry #2`, `'consolidator'`) with every problem it has, so one edit fixes them all; when an entry gives no harness, a line saying what every entry needs follows, and, if no entry gives one (as in a 0.1.0 config, which ran everything under pi), a hint to add `harness: pi`. A run made by 0.1.0, when every entry ran under pi, has a config copy without `harness`; `--consolidate` rejects its consolidator like any other entry, with a hint to add `harness: pi`, while its reports and `run.json` are still read as pi's.
116
+ Every entry gives `harness`, `provider`, and `model`, each a nonblank string; there are no defaults, and no `defaults:` section supplying them (one was considered and rejected). A default harness or provider would go stale as harnesses change (pi is the right default only as long as it is), and a `defaults:` section's provider would apply across harnesses whose providers differ. `harness` is `pi`, `claude`, or `codex`; an unknown one is rejected at startup (with `--consolidate`, only the consolidator's, since no analysts run). A `claude` entry's provider is not passed to Claude Code (§4) and only labels the agent (e.g. `bedrock`, for a `claude` set up to use it); likewise a `codex` entry's, since Codex uses the `model_provider` its config names. A config error lists every bad entry, each named by its key (`'agents' entry #2`, `'consolidator'`) with every problem it has, so one edit fixes them all; when an entry gives no harness, a line saying what every entry needs follows, and, if no entry gives one (as in a 0.1.0 config, which ran everything under pi), a hint to add `harness: pi`. A run made by 0.1.0, when every entry ran under pi, has a config copy without `harness`; `--consolidate` rejects its consolidator like any other entry, with a hint to add `harness: pi`, while its reports and `run.json` are still read as pi's.
117
117
 
118
- Exact provider and model identifiers must be verified against the installed harness: `pi --list-models` for pi, and the names and aliases `claude --model` accepts for Claude Code.
118
+ Exact provider and model identifiers must be verified against the installed harness: `pi --list-models` for pi, the names and aliases `claude --model` accepts for Claude Code, and the names `codex --model` accepts for Codex.
119
119
 
120
120
  They belong in configuration because available models and names change frequently.
121
121
 
@@ -153,7 +153,7 @@ Agents run concurrently, one Ruby thread per agent, each driving one harness pro
153
153
  `AgentCouncil::WorkerPool` (`lib/agent_council/worker_pool.rb`) also handles signals, keeping the main thread free to take them. The README's [Stopping a run](README.md#stopping-a-run) section describes what Ctrl-C and the other signals do; the reasons behind that behavior are:
154
154
 
155
155
  - **Each agent leads its own process group**, so the terminal's signals reach only agent-council, which then stops the agents itself, in an orderly way, and Ctrl-Z suspends agent-council without suspending the agents under it.
156
- - **Agents get SIGTERM and a shared grace period before being killed**, so the harness can stop the commands it started (pi and Claude Code do; checked for Claude Code 2.1.325: a command its Bash tool was running, in the foreground or with `run_in_background`, ran in a process group of its own, which agent-council's SIGTERM to the agent's group doesn't reach, and ended when `claude` got SIGTERM); a second signal skips the wait for a user who doesn't want to.
156
+ - **Agents get SIGTERM and a shared grace period before being killed**, so the harness can stop the commands it started (pi, Claude Code, and Codex do; checked for Codex 0.167.0: a running `sleep` was gone after `codex` got SIGTERM; checked for Claude Code 2.1.325: a command its Bash tool was running, in the foreground or with `run_in_background`, ran in a process group of its own, which agent-council's SIGTERM to the agent's group doesn't reach, and ended when `claude` got SIGTERM); a second signal skips the wait for a user who doesn't want to.
157
157
  - **agent-council then dies by the signal** rather than exiting normally, so a shell (e.g. one running it in a loop) sees it was killed and stops too. SIGQUIT exits 131 instead, since a core dump is no use here.
158
158
  - **Extra SIGHUPs are ignored**, since a closing terminal can send them in pairs, and **signals agent-council was started ignoring stay ignored**, so `nohup` works.
159
159
  - **SIGQUIT isn't trapped under JRuby**, where the JVM reserves it for thread dumps.
@@ -194,12 +194,13 @@ The harness is started with an argv array, not through a shell.
194
194
 
195
195
  Agents are analyzers, not modifiers.
196
196
 
197
- The scaffolding appended to each agent's system prompt (`Harnesses.scaffold_text` in `lib/agent_council/harnesses/scaffold.rb`, shared by every harness) states the rules agents get, and the README's [How it works](README.md#how-it-works-and-what-the-agents-are-told) section summarizes them. They are instructions, not enforced restrictions: each harness's tool limit (pi's `--tools` allowlist, which activates only the tools it lists; Claude Code's `--tools`) and its MCP setting (§11) are the only restrictions agent-council enforces (Claude Code's own sandbox can also restrict Claude Code agents if Claude Code's settings enable it, and the analyzed repository's settings can enable or disable it; §11), and the shell tool remains a full shell running as the user (see the README's [Safety and privacy](README.md#safety-and-privacy)). A shell is kept because investigation (`git log`, dependency inspection, running a documented command) is much of what makes an analysis useful.
197
+ The scaffolding appended to each agent's system prompt (`Harnesses.scaffold_text` in `lib/agent_council/harnesses/scaffold.rb`, shared by every harness) states the rules agents get, and the README's [How it works](README.md#how-it-works-and-what-the-agents-are-told) section summarizes them. They are instructions, not enforced restrictions: each harness's tool limit (pi's `--tools` allowlist, which activates only the built-in, extension, and custom tools it lists, and the MCP tools that `codemode`, `tool_search`, and `mcp__*` reach, §11; Claude Code's `--tools`; Codex has none, §11) is the only restriction agent-council enforces (Claude Code's own sandbox can also restrict Claude Code agents if Claude Code's settings enable it, and the analyzed repository's settings can enable or disable it; Codex's sandbox restricts Codex agents as the user's Codex config sets it; §11), and the shell tool remains a full shell running as the user (see the README's [Safety and privacy](README.md#safety-and-privacy)). A shell is kept because investigation (`git log`, dependency inspection, running a documented command) is much of what makes an analysis useful.
198
198
 
199
199
  The rules follow from agents running concurrently in the user's own working tree:
200
200
 
201
201
  - **No modifying project files, git state, software, or configuration, and no persistent services**, since the agents analyze the user's real repository and environment, not a copy. If testing a proposed change would need a modified file, the agent should describe the experiment instead (this follows from the rule; the scaffolding doesn't state it separately).
202
- - **Each agent gets its own disposable scratch directory** (its `TMPDIR`, which the scaffolding names rather than giving a path: under Claude Code's sandbox the dir itself is read-only and `TMPDIR` is a writable dir inside it, §11), so agents that need temporary files don't collide with each other or leave files in the project.
202
+ - **Each agent gets its own disposable scratch directory** (its `TMPDIR`, which the scaffolding names rather than giving a path: under Claude Code's sandbox the dir itself is read-only and `TMPDIR` is a writable dir inside it, §11; under Codex's `read-only` sandbox nothing is writable, `TMPDIR` included, so Codex agents then have no scratch space), so agents that need temporary files don't collide with each other or leave files in the project.
203
+ - **No acting outside the machine** (posting, commenting, sending messages, or changing issues, tickets, or other remote data), with any tool, since agents get the user's MCP servers (§11), some of which write, and a council would do it once per agent. Reading remote information stays allowed.
203
204
  - **No test suites, builds, coverage tools, application servers, or database tasks unless the prompt permits them**, since such commands can collide through shared resources a per-agent scratch directory doesn't isolate: shared databases, Redis, fixed ports, Docker resources, hard-coded temporary paths, or other process-global state. Running tests and reproducing defects can make an analysis much stronger, so a prompt may lift the rule (as `examples/prompts/review-latest-commit-prompt.md` does for tests and linters); agents then still skip commands needing shared services. Where a command is not permitted but would help, the agent describes what it would run and why.
204
205
 
205
206
  ---
@@ -224,7 +225,6 @@ Pi's exceptions to normal behavior:
224
225
 
225
226
  - each agent is independent;
226
227
  - no conversation/session state leaks between agents (`--no-session`);
227
- - pi's built-in MCP support is off (`--no-mcp`), so configured MCP servers don't start, which keeps any from doing something merely by starting, and agents have no MCP tools; an extension providing its own MCP support isn't affected, and extensions load as usual;
228
228
  - the tool list is restricted and the scaffolding appended to the system prompt (§10);
229
229
  - the report-format addendum is appended to each analyst's prompt.
230
230
 
@@ -237,17 +237,15 @@ claude -p --output-format stream-json --verbose
237
237
  --no-session-persistence
238
238
  --tools Read,Grep,Glob,Bash --allowedTools Read,Grep,Glob,Bash
239
239
  --permission-mode manual
240
- --strict-mcp-config
241
240
  --model MODEL
242
241
  --append-system-prompt SCAFFOLDING
243
242
  ```
244
243
 
245
- The flags were checked with Claude Code 2.1.325, and again with 2.1.327 (and, for the comparison with pi's allowlist, pi 1.5.2):
244
+ The flags were checked with Claude Code 2.1.325, and again with 2.1.327 and 2.1.329 (and, for the comparison with pi's allowlist, pi 1.5.2):
246
245
 
247
246
  - `--tools` limits the built-in tools as pi's allowlist does: Edit and Write are absent, not merely refused.
248
247
  - `--allowedTools` is required. Without it, Bash commands Claude Code doesn't consider read-only (`git log` and `ls` are; `ruby -e ...` isn't) are refused, since `-p` mode can't ask, and the agent still ends as a success, with the refusal recorded only in the `result` event's `permission_denials`. With it, a call can still be refused, by a `permissions.deny` rule in the user's or the analyzed project's settings (checked: a project rule denying `Bash(cat:*)` was recorded the same way). A nonempty `permission_denials` is reported as a warning naming the refused calls (`ClaudeCodeHarness.warnings`), printed under the agent's progress line, shown in the report's byline table (which the consolidator reads, and which its template asks it to take into account), and recorded in its `run.json` entry, not a failure: the report is kept, but may lack what the call would have found. An agent that fails anyway (say, by running out of turns after refusals) gets the warning too, since the refusals may be why; it follows the failure reason on the console, in `run.json`, and in the reason the consolidation prompt gives for the missing report.
249
248
  - `--permission-mode manual` makes the outcome the same for every user; without it the user's own `defaultMode` (e.g. `auto`, or `plan`, which would run nothing) applies (checked: with `defaultMode` set to `plan`, the `init` event reports `plan` without the flag and `default` with it). `manual` is the name `claude --help` lists for the mode the stream reports as `default`; `default` is still accepted but no longer listed, so it isn't used.
250
- - `--strict-mcp-config` with no `--mcp-config` loads no MCP servers: `init` reports `mcp_servers: []` even for a user with servers configured, and a plugin that provides MCP tools doesn't load, while other plugins do (checked). Not tested: an enterprise `managed-mcp.json`, under which Claude Code's binary has the message "You cannot use --strict-mcp-config when an enterprise MCP config is present", so Claude Code agents would presumably fail there; the README notes it.
251
249
 
252
250
  **Context.** Claude Code behaves as in an interactive session started in the analyzed repository, as pi does (above): it loads `CLAUDE.md` (and whatever it imports, such as `@AGENTS.md`), user and project settings, hooks, and plugins, and its auto memory for the project. Auto memory is kept deliberately (checked: the system prompt names the project's memory directory, shows its `MEMORY.md` index, and says to write memory files there; `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` removes all of it): the notes are context an interactive session would have, and leaving them out would make agents worse at the user's project. An agent may still write a memory file with `Bash`, as an interactive session may (the scaffolding's "strictly read-only" rules argue against it, but don't name memory); that is accepted, and the README says so. `--bare` is not used: it skips `CLAUDE.md` and permits only API-key authentication. Nor is `--safe-mode`, which keeps subscription authentication but also skips `CLAUDE.md`, along with skills, plugins, hooks, and other customizations (permission rules and admin-managed settings still apply); nor is `--restricted`, which ignores the user, project, and local settings files altogether, permission rules included, and so would drop both the user's own setup and a project's deny rules (untested); a user who wants that can set `CLAUDE_CODE_SAFE_MODE=1` (its environment form) when running agent-council, and the README's Safety section says so (checked: with it, a project's hooks didn't run and a subscription login still worked). So the user's hooks and plugins run for every Claude Code agent, and so do hooks in the analyzed repository's own `.claude` settings: `-p` mode skips the trust prompt an interactive session shows first in a new folder (checked: a never-trusted repository's `SessionStart` and `PreToolUse` hooks ran). The README's Safety section says so.
253
251
 
@@ -262,9 +260,43 @@ The flags were checked with Claude Code 2.1.325, and again with 2.1.327 (and, fo
262
260
 
263
261
  **Billing.** agent-council leaves authentication and billing entirely to Claude Code: it passes no option and sets no environment variable for them (the only variables it sets for an agent are `TMPDIR` and `CLAUDE_CODE_TMPDIR`, both to its scratch dir, §10). An agent bills however `claude` would at the user's terminal: a subscription login, or an API key if one is configured. One caveat, which the README gives: interactive Claude Code asks before using an `ANTHROPIC_API_KEY` found in the environment, but `-p` mode doesn't ask, so a key exported for another tool may bill council runs to the API. Subscription runs also share the user's usage limits with their interactive work; a limit hit while an agent is working is expected to end it as an ordinary agent failure, but that hasn't been observed (§13). The reported cost is recorded unadjusted (only rounded to six decimal places); like other subscription providers' figures it is notional (the stream gives its `costBasis` as `list`). Telling billing sources apart in `run.json` is not built (§18); the sources for it are the `init` event's `apiKeySource` (`none` for a login), `claude auth status --json` (`subscriptionType`, e.g. `pro`), and the stream's `rate_limit_event`s, which give the plan's utilization of its 5-hour and weekly windows.
264
262
 
265
- ### No MCP, in either harness
263
+ ### Codex
266
264
 
267
- Agents get no MCP servers, so neither harness offers MCP tools (their built-in tools differ, as listed above), and no agent can reach a server that writes (posting to chat, commenting on an issue), which a council would do once per agent. Pi is passed `--no-mcp` (above), which turns off its built-in MCP support (an extension providing its own is unaffected) and in a test kept a project's server from starting; before that, its `--tools` allowlist already kept agents from calling MCP tools, but pi still started the user's servers. There is no setting to turn MCP on. If one is wanted later, it goes in the config, not on the command line, and names the servers to allow rather than switching all of them on, since enabling means per-harness work: pi's allowlist would have to name the MCP tools, and Claude Code would need them in `--allowedTools`.
265
+ **Invocation.** One `codex exec` process per agent, the prompt on stdin, started from an argv array (§9):
266
+
267
+ ```text
268
+ codex exec --json --ephemeral --skip-git-repo-check --color never
269
+ --model MODEL
270
+ -c developer_instructions=SCAFFOLDING
271
+ -
272
+ ```
273
+
274
+ Checked with codex-cli 0.167.0:
275
+
276
+ - `-c developer_instructions=...` adds the scaffolding to the system prompt (checked: an instruction given this way was followed). It replaces any `developer_instructions` the user's config sets; Codex has no option that appends.
277
+ - `--skip-git-repo-check` is needed outside a git repository Codex trusts: without it Codex refuses ("Not inside a trusted directory"), while pi and Claude Code agents run anywhere.
278
+ - Codex's `read-only` and `workspace-write` sandboxes also block network access unless the user's config allows it (checked with `codex sandbox`: `curl` couldn't resolve a host under either, and worked unsandboxed).
279
+ - No `--sandbox` or approval option is passed: the user's `sandbox_mode` applies, as in an interactive session (§11's premise). The user's `approval_policy` doesn't: `codex exec` never asks, so a command that needs approval is refused (checked: an agent told `approval_policy="on-request"` reported `never`, and `"untrusted"` made `codex exec` exit with "no longer supported"). Under `read-only`, Codex's default, commands can write nothing, `$TMPDIR` included (checked: "read-only file system"), so agents get no scratch space although the scaffolding offers it; under `workspace-write`, `$TMPDIR` is writable (checked), and so is the analyzed repository. Forcing `read-only` was tried and dropped: it overrode the user's setting, and the scaffolding would have needed a variant without scratch space.
280
+ - No tool is withheld: this Codex version has no option for it. Codex agents keep `apply_patch` (file editing) and the subagent tools (`spawn_agent` and others); `--disable multi_agent`, `-c features.multi_agent=false`, and `-c include_apply_patch_tool=false` each left them in the rendered prompt (`codex debug prompt-input`). The README says so. The subagent tools fail, though: under `--ephemeral`, `spawn_agent` fails with "collab spawn failed: ... no rollout found for thread id" (on stderr; the stream shows only the agent's `wait`), and the agent carries on alone (checked with codex-cli 0.167.0). That also keeps usage whole: without `--ephemeral`, a subagent ran, and its tokens (31,708 input in its own session) were not in its parent's `turn.completed`, which matched the parent's session alone. If a Codex version lets `--ephemeral` agents spawn, usage will undercount them.
281
+ - MCP servers load; see below.
282
+
283
+ **Context.** Codex behaves as in an interactive session started in the analyzed repository: it loads the user's `config.toml`, skills, plugins, and hooks it trusts, and the project's `AGENTS.md` files (and its `.codex` config, if the user trusts the project; checked: skill instructions appear in the rendered prompt). `--ignore-user-config` is not used.
284
+
285
+ **Billing.** agent-council leaves authentication and billing to Codex: a ChatGPT login or an API key, however `codex` would bill at the user's terminal. The entry's provider only labels the agent; Codex uses the `model_provider` its config names.
286
+
287
+ ### MCP servers load, in every harness
288
+
289
+ Agents get the MCP servers the user has configured for their harness, as an interactive session would: pi's (`~/.pi/agent/mcp.json`, a trusted project's, and extensions'), Claude Code's (the user's, plugins', and the project's approved ones), and Codex's (`config.toml`, plugins, the apps connectors, and a trusted project's). agent-council passes no MCP option. Leaving them out would make agents worse at the user's own work (a coverage server, an issue tracker, internal docs), which matters more here than isolation (§11's premise).
290
+
291
+ The cost is risk, which the README's Safety section states prominently. A server that writes (posting to chat, commenting on an issue, changing a ticket) is available to every agent, held back only by the scaffolding's read-only instructions, and a council would do it once per agent; and each agent starts every server it loads, so a server that acts merely by starting acts once per agent. The user's remedy is their own config (remove or disable the server), or an environment without it.
292
+
293
+ How each harness exposes the tools (checked with pi 1.5.2, Claude Code 2.1.329, and codex-cli 0.167.0, calling a `version` tool on a local stdio server):
294
+
295
+ - **pi** exposes MCP tools through its `codemode` tool by default, so `codemode` is in the `--tools` allowlist (checked: without it, agents had no MCP access). A server with direct exposure has its tools activated only if `--tools` names them, so `mcp__*` is listed too (checked: without it, a direct server's tool was unavailable). A server with deferred exposure has its tools loaded by `tool_search`, so that is listed as well; it loads only MCP tools (checked: `tool_search` for `write` and `edit` found nothing). Since naming an `mcp__` entry makes `--tools` filter MCP tools by name, pi's resource tools (`list_mcp_resources`, `list_mcp_resource_templates`, `read_mcp_resource`) are listed too. A `codemode` script can call only the allowlisted tools and MCP tools (checked: its `tools` object had them and the resource tools, and no `write`), plus pi's `models` API (`models.classify`, `models.generateImages`), which calls models itself; pi reports that usage on the `codemode` tool result, so `PiHarness.usage` counts tool results' usage along with assistant messages'. `tool_search` is listed for deferred exposure but also finds codemode-exposed tools, which `codemode` reaches anyway. Listing `codemode` activates it even when the user's pi settings set `autoEnableCodemode` to false; agents can't otherwise reach MCP tools with the default exposure. pi doesn't ask before a tool runs, so pi agents can call any MCP tool they get. A failed MCP call reaches a pi agent as a tool result marked `isError`, which the agent can read; agent-council doesn't warn of it (`PiHarness.warnings` returns none), unlike Claude Code's and Codex's refused calls, since a pi failure is an ordinary tool error, not a refusal, and pi reports a server that fails to start only in its interactive UI. Unlisted extension tools stay out of reach even with `codemode` and `tool_search`: pi drops tools the allowlist doesn't match before registering them, and both reach only registered tools (pi 1.5.2's `_refreshToolRegistry`, `_getCallableTools`).
296
+ - **Claude Code** loads the servers, but `-p` can't ask permission, so an MCP call goes through only if a permission rule allows it (e.g. `mcp__server` in `permissions.allow`); otherwise it is refused and lands in `permission_denials`, which `ClaudeCodeHarness.warnings` reports. MCP tools are not added to `--allowedTools`: that would give agents more than an interactive session has without the user's approval.
297
+ - **Codex** loads the servers, but `codex exec` never asks for approval, so an MCP call goes through only if the user's config approves the tool in advance (`default_tools_approval_mode = "approve"` on a server, or `approval_mode = "approve"` on one of its tools); otherwise the `mcp_tool_call` item fails with "MCP tool call requires approval, but approval policy is never", which `CodexHarness.warnings` reports.
298
+
299
+ 0.2.0 and the Codex harness's first version turned MCP off instead (pi's `--no-mcp`, Claude Code's `--strict-mcp-config`, and for Codex a per-server `enabled=false` table built from `codex mcp list`, plus `--disable apps`). That was reversed: it crippled agents relative to the user's setup, and Codex's version was fragile (a plugin's server in the listing made the override fail with "invalid transport", failing every agent). `pi-models` still passes `--no-mcp`, since it only lists models and runs no agent.
268
300
 
269
301
  ---
270
302
 
@@ -324,9 +356,22 @@ agent-council reads Claude Code's `stream-json` output. The stream's final `resu
324
356
  - the failure's reason is the `result` event's `errors`, if any (e.g. "Reached maximum number of turns (1)", with an empty `result`), otherwise its `result` text (e.g. "Not logged in · Please run /login"). Stderr was empty in all but one case, so unlike pi's, a nonzero exit is explained from the stream, with stderr only as a fallback;
325
357
  - usage is read from the `result` event alone, which totals the agent's whole session; the per-message `assistant` events carry partial snapshots that undercount output (in one recorded case, 16 output tokens where the `result` event gave 184). So an agent that ends without a `result` event, as when its `claude` is killed, reports no usage rather than a misleading partial count, unlike a pi agent, whose completed messages each report their full usage. It maps `input_tokens`, `output_tokens`, `cache_read_input_tokens`, and `cache_creation_input_tokens` to `input`, `output`, `cache_read`, and `cache_write` (as with pi, `input` excludes cache reads and writes), and `total_cost_usd` to `cost`.
326
358
 
327
- So `exit_detail`, which explains a nonzero exit, reads the stream first for Claude Code and stderr for pi. The parser and the invocation live in `AgentCouncil::Harnesses::ClaudeCodeHarness` (`lib/agent_council/harnesses/claude_code_harness.rb`). The specs read streams recorded from real `claude` invocations (`spec/fixtures/claude_code/`), trimmed to a few event types and fields, with local paths, tool call IDs, and commit hashes replaced by placeholders; the spec's header says how each was recorded.
359
+ So `exit_detail`, which explains a nonzero exit, reads the stream first for Claude Code (and Codex, below) and stderr for pi. The parser and the invocation live in `AgentCouncil::Harnesses::ClaudeCodeHarness` (`lib/agent_council/harnesses/claude_code_harness.rb`). The specs read streams recorded from real `claude` invocations (`spec/fixtures/claude_code/`), trimmed to a few event types and fields, with local paths, tool call IDs, and commit hashes replaced by placeholders; the spec's header says how each was recorded.
360
+
361
+ Not yet observed for Claude Code: an agent that hits a usage limit, and one billed to an API key.
362
+
363
+ ### Codex
364
+
365
+ agent-council reads `codex exec --json`'s event stream:
366
+
367
+ - the report is the text of the last `agent_message` item with text, in a turn that ended in `turn.completed` (earlier agent messages narrate tool use; a trailing blank one, not observed, would not hide the report, as for pi);
368
+ - the agent failed if there is no `turn.completed` or `turn.failed` event, the turn ended in `turn.failed`, or the completed turn has no message text. An unsupported model exited 1 with `turn.failed` whose `error.message` gave the reason, and an empty stderr; so, as for Claude Code, a nonzero exit is explained from the stream (`turn.failed`, else the last top-level `error` event), with stderr as a fallback;
369
+ - `error` items that don't fail the turn (e.g. "Model metadata for `x` not found") become one warning listing at most five distinct messages, each cut to 200 characters, and failed `mcp_tool_call` items (e.g. a call refused for want of approval, §11) another, listing at most five distinct `server.tool (reason)` entries (just `tool` when the server is missing, `unknown tool` when the tool is), cut the same way;
370
+ - usage comes from `turn.completed`. Codex's `input_tokens` counts all input, as OpenAI's API does, so `cached_input_tokens` and `cache_write_input_tokens` are subtracted from it for `input` (as with pi, `input` excludes cache reads and writes); reasoning tokens are part of `output_tokens`. Codex prices nothing, so there is no `cost`, and a run's total cost (`total_usage`'s `cost`) is omitted when a Codex agent reported usage (an agent with no usage, e.g. one that failed, is left out of the total); the console summary then gives the other analysts' known cost, and `run.json`'s `known_cost` and `known_cost_runs` that of every entry with one. A ChatGPT login always reported 0 cache writes, so the subtraction of writes is untested against real output.
371
+
372
+ The parser and the invocation live in `AgentCouncil::Harnesses::CodexHarness` (`lib/agent_council/harnesses/codex_harness.rb`). The specs read streams recorded from real `codex` invocations (`spec/fixtures/codex/`), with the thread ID zeroed and command items replaced by placeholders.
328
373
 
329
- Not yet observed: an agent that hits a usage limit, and one billed to an API key.
374
+ Not yet observed for Codex: an agent that hits a usage limit, and one billed to an API key.
330
375
 
331
376
  ---
332
377
 
@@ -394,6 +439,7 @@ lib/
394
439
  scaffold.rb # the read-only scaffolding every harness appends
395
440
  pi_harness.rb # pi-specific behavior (AgentCouncil::Harnesses::PiHarness)
396
441
  claude_code_harness.rb # Claude Code-specific behavior (ClaudeCodeHarness)
442
+ codex_harness.rb # Codex-specific behavior (CodexHarness)
397
443
  templates/ # runtime data files (resolved via __dir__, shipped in the gem)
398
444
  consolidate_prompt.md # instructions template for the consolidator
399
445
  analyst_format.md # report-format addendum for analysts
@@ -438,7 +484,7 @@ New gems are added only if they solve a meaningful problem that would otherwise
438
484
 
439
485
  ## 18. Status and Future Work
440
486
 
441
- agent-council is at an early stage (0.x), so it does only what its core job needs. Features we hope to add include support for more harnesses (such as Codex) and telling a Claude Code agent's billing source (subscription or API key) apart in `run.json` (§11). A missing feature is usually just not built yet.
487
+ agent-council is at an early stage (0.x), so it does only what its core job needs. Features we hope to add include support for more harnesses and telling a Claude Code agent's billing source (subscription or API key) apart in `run.json` (§11). A missing feature is usually just not built yet.
442
488
 
443
489
  `REVIEW_NOTES.md` separately tracks review findings that were considered and don't need to be re-raised: accepted risks and non-issues.
444
490
 
data/INSTALL.md CHANGED
@@ -3,14 +3,14 @@
3
3
  This guide is for developers comfortable with the command line who have
4
4
  never used Ruby. It takes you from a bare machine to a working
5
5
  `agent-council` command. Already have Ruby 3.3+ (or JRuby 10+) and
6
- `pi` (or Claude Code)? Just run `gem install agent-council`; see the
6
+ a harness CLI (`pi`, Claude Code, or Codex)? Just run `gem install agent-council`; see the
7
7
  [README](README.md#quick-start).
8
8
 
9
9
  ## 1. Prepare your system
10
10
 
11
11
  - **macOS and Linux:** any terminal works. Linux needs `curl` installed.
12
12
  - **Windows:** native Windows is **not supported**. Everything, including
13
- Ruby, the harness CLIs you use (Pi, Claude Code, or both), and
13
+ Ruby, the harness CLIs you use (Pi, Claude Code, Codex, or any mix), and
14
14
  agent-council, must be installed and run inside
15
15
  [WSL](https://learn.microsoft.com/windows/wsl/install) with Ubuntu. In
16
16
  an administrator PowerShell, run `wsl --install -d Ubuntu`, restart if
@@ -74,7 +74,7 @@ For other install methods and details, see the
74
74
  [Mise documentation](https://mise.jdx.dev/getting-started.html) and its
75
75
  [Ruby page](https://mise.jdx.dev/lang/ruby.html).
76
76
 
77
- ## 3. Install a harness: Pi, Claude Code, or both
77
+ ## 3. Install a harness: Pi, Claude Code, Codex, or several
78
78
 
79
79
  agent-council drives AI models through a coding-agent harness, which
80
80
  each config entry names. Most samples use the
@@ -88,8 +88,10 @@ inside WSL.
88
88
  Agents can also run under [Claude Code](https://code.claude.com/docs)
89
89
  (see the README's [Choosing a harness](README.md#choosing-a-harness)).
90
90
  For those, install the `claude` CLI and log in (under WSL, inside WSL).
91
- A config needs Pi only if some agent, or the consolidator, runs under it
92
- (`harness: pi`).
91
+ Likewise for [Codex](https://developers.openai.com/codex/cli): install
92
+ the `codex` CLI and log in. A config needs each harness only if some
93
+ agent, or the consolidator, runs under it (`harness: pi`, `claude`, or
94
+ `codex`).
93
95
 
94
96
  ## 4. Install agent-council
95
97