Skip to content

fix: make agent spawning work under Codex (inline fallback + native TOML)#18

Merged
gabelul merged 2 commits into
mainfrom
feat/harness-neutral-spawning
Jun 10, 2026
Merged

fix: make agent spawning work under Codex (inline fallback + native TOML)#18
gabelul merged 2 commits into
mainfrom
feat/harness-neutral-spawning

Conversation

@gabelul

@gabelul gabelul commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Completes the cross-harness correctness work started by the asking-protocol fix. Targets the same held release as the exhaustive-by-default set (PR #16).

The bug

The installer copies our agent specs (orchestrator, setup, fixer, checker, + 7 internal evaluators) into .codex/agents/ as Markdown with Claude Code frontmatter. But Codex custom agents must be TOML in its own schema. So Codex recognizes none of them — and the orchestrator only knew how to spawn evaluators, not run them itself. A scan under Codex would fail.

The fix (inline fallback)

A harness-neutral spawn protocol: spawn a named agent as a subagent if your harness supports it, otherwise read its spec and run it inline, in sequence. The orchestrator now falls back to running all 7 evaluators inline against the same evidence bundle — identical scores and findings, just sequential. Mirrors the asking-protocol pattern, and it's what impeccable's critique does.

Works on Codex and any future harness, with zero dependency on an external schema. Native Codex TOML agents (for real parallelism) are a deliberate later optimization, only worth it once Codex's subagent model stabilizes.

Tests

1028 passing. The discoverability drift-guard now also asserts the spawn protocol exists, names Codex, gives the inline fallback, and that the orchestrator carries it.

Gabi added 2 commits June 10, 2026 11:24
The installer copies our agent specs into .codex/agents/ as Markdown, but Codex
custom agents must be TOML in its own schema — so Codex can't spawn any of them,
and a scan's "Spawn agent: X" instructions pointed at agents that don't exist
there. The orchestrator only knew how to spawn, not how to run an evaluator
itself, so a Codex scan would fail outright.

Adds a harness-neutral spawn protocol: spawn a named agent as a subagent if the
harness supports it, otherwise read its spec and run it inline, in sequence. The
orchestrator now falls back to running all 7 evaluators inline against the same
evidence bundle — same scores and findings, just sequential. Drift-guarded.

This is the robust baseline that makes the skill portable, not just Codex-aware.
Native Codex TOML agents for real parallelism can come later if its subagent
schema settles.
The inline fallback makes Codex work, but it leans on Codex interpreting our
Markdown specs correctly every run. This adds the native path: at install,
generate a Codex custom-agent TOML (.codex/agents/<name>.toml) from each spec so
Codex spawns them directly. The .md stays put for the inline fallback, so it's
belt-and-suspenders — native spawn when it works, inline when it doesn't.

agentMdToCodexToml emits the three required fields (name, description,
developer_instructions). model and sandbox_mode are omitted so a spawned agent
inherits the parent's settings — mapping Claude's "sonnet" onto a Codex model
would be wrong. The body goes in a TOML literal block so backslashes and regex in
code examples survive verbatim. Uninstall removes the generated pixelslop*.toml.

Verified end to end: a real install writes 13 valid TOMLs (6 agents + 7
evaluators). Can't live-test spawning on Codex from here, which is exactly why
the inline fallback is the safety net.
@gabelul gabelul changed the title fix: run agents inline when the harness can't spawn them fix: make agent spawning work under Codex (inline fallback + native TOML) Jun 10, 2026
@gabelul gabelul merged commit 5f9f850 into main Jun 10, 2026
4 checks passed
@gabelul gabelul deleted the feat/harness-neutral-spawning branch June 10, 2026 10:00
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.

1 participant