Skip to main content
Glama

Codex Stage Orchestrator

IMPORTANT

This is an independent open-source project, not an official OpenAI product. Version0.1.x is an early release: its evidence and safety contracts are deliberate, while host UI integration may evolve with Codex.

Why this exists

Different phases of a software task benefit from different roles and, sometimes, different models. But orchestration becomes untrustworthy when it cannot answer three basic questions:

  1. What route was configured?

  2. Did Codex accept that route?

  3. Which model did the host actually report at runtime?

Codex Stage Orchestrator answers each question separately. It gives one root agent responsibility for the whole task, routes only the stages that benefit from specialization, and keeps a small local evidence ledger populated by Codex lifecycle hooks.

Related MCP server: Proof Mode

At a glance

Capability

Behavior

Stage routing

Maps discovery, planning, design, development, review, verification, and delivery to logical roles.

Role routing

Keeps a role on the root, launches an exact Codex subagent route, or explicitly skips it.

Current tasks

Activates a profile for one existing task without changing other tasks.

Future tasks

Selects a default profile that new tasks capture when they start.

Live evidence

Records root and subagent model slugs mechanically reported by lifecycle hooks.

Enforcement

Observes mismatches by default; optionally denies mismatched agent launches in strict mode.

Privacy

Never reads transcripts or stores prompts, agent messages, generated work, or unrelated tool inputs.

Runtime

Dependency-free Node.js MCP server and hook handler.

How it works in practice

Imagine asking Codex to build a new product surface.

1. A task starts

The SessionStart hook registers the task id, active profile, working directory, and the root model slug reported by Codex. It injects the exact task id into agent context; it does not read the transcript.

2. The root chooses useful stages

The orchestration skill evaluates the request. A simple bug may need only development and verification. A new interface may benefit from planning, design, development, review, and verification. It does not create agents merely to prove orchestration is enabled.

3. A stage resolves to a role and route

Profiles use a two-step mapping:

stage → role → route

For example:

planning     → planner   → agent:model-planning
design       → designer  → agent:model-design
development  → developer → agent:model-development
review       → reviewer  → agent:model-review
verification → verifier  → root

Before work begins, Codex shows a compact status update:

Orchestration · planning · planner → agent:model-planning · evidence: configured

4. The route runs

  • A root route keeps the stage in the current task.

  • An agent route launches a bounded subagent with the exact configured type, model, effort, service tier, and context-forking policy.

  • A skip route deliberately omits the stage.

The root remains responsible for decomposition, task packets, integration, verification, and the final response. A subagent never owns the whole user request.

5. Hooks confirm what happened

The pre-tool hook records the requested routing fields and can reject mismatches in strict mode. SubagentStart records the agent id, type, and model slug reported by Codex. If the configured and observed values differ, status shows both and flags the mismatch.

6. The root integrates the result

When the stage finishes, the root checks the result, records a short non-sensitive outcome, moves to the next useful stage, and eventually returns one integrated answer to the user.

This is the central boundary: the plugin does not hot-swap the root model inside an existing task. A stage assigned to another model runs as a Codex subagent.

Architecture

flowchart LR
    U["User request"] --> R["Accountable root agent"]
    R --> S["Stage orchestration skill"]
    S --> C["Local MCP control plane"]
    C <--> L["Private evidence ledger"]
    S -->|"exact bounded route"| A["Codex subagent"]
    H["Lifecycle hooks"] -->|"runtime evidence"| L
    A --> R
    R --> U

See Architecture and Protocol for state transitions, locking, trust boundaries, and the complete MCP contract.

Installation

Requirements

  • A Codex build with plugin and lifecycle-hook support.

  • Node.js 20 or newer available as node.

  • Git, for marketplace installation and updates.

The package follows the official Codex plugin authoring and lifecycle hook contracts.

Install from GitHub

codex plugin marketplace add slegarraga/codex-stage-orchestrator
codex plugin add codex-stage-orchestrator@codex-stage-orchestrator

Then:

  1. Review and trust the bundled hook definition when Codex asks.

  2. Open a new Codex task so SessionStart can register it.

  3. Ask: “Show my current orchestration profile and live model evidence.”

Plugin hooks are not trusted automatically. Without hook trust, profile and stage configuration still work, but the plugin correctly reports runtime model evidence as unavailable.

Install from a local checkout

git clone https://github.com/slegarraga/codex-stage-orchestrator.git
cd codex-stage-orchestrator
codex plugin marketplace add .
codex plugin add codex-stage-orchestrator@codex-stage-orchestrator

First five minutes

The built-in balanced profile is intentionally safe: every role stays on the root until you configure it.

Use natural language in Codex:

  1. Inspect: “Show the active orchestration profile, every stage role, and current evidence.”

  2. Create: “Create a profile called specialists based on balanced.”

  3. Configure: “Route planning to model model-planning, design to model-design, development to model-development, and review to model-review.”

  4. Test safely: “Keep this profile in observe mode and use it only for this task.”

  5. Promote later: “After I confirm, make specialists the default for future tasks.”

Persistent configuration tools require explicit confirmation. The agent cannot silently change a shared profile or future-task default.

Profiles, roles, and routes

The standard stages are:

Stage

Default role

Typical purpose

Required by default

discovery

researcher

Inspect unknowns and gather bounded evidence.

No

planning

planner

Decide scope, architecture, sequence, and acceptance criteria.

Yes

design

designer

Make UX, visual, interaction, or artifact decisions.

No

development

developer

Implement the approved work.

Yes

review

reviewer

Independently inspect correctness, quality, and risk.

Yes

verification

verifier

Run proportionate tests and validate the visible outcome.

Yes

delivery

release_manager

Package, publish, or hand off a verified result.

No

Route types

Keep a role on the current task model:

{ "kind": "root" }

Launch a bounded Codex agent:

{
  "kind": "agent",
  "agent_type": "worker",
  "model": "model-a",
  "reasoning_effort": "high",
  "service_tier": "priority",
  "fork_turns": "none"
}

Explicitly skip a role:

{ "kind": "skip", "reason": "No visual surface in this workflow." }

Model ids are opaque strings. The plugin never guesses an id or claims it is available before Codex accepts or observes a launch. See the complete generic example at examples/profiles/specialists-observe.json.

Current task versus future tasks

User intent

Scope

Result

“Use specialists here.”

Current task

Only this task points to that profile.

“Make specialists my default.”

Future tasks

New tasks capture that profile at SessionStart; existing tasks keep theirs.

“Change the developer route in specialists.”

Profile

Future stages in every task referencing that profile resolve the updated route.

“Clone specialists for this experiment.”

New profile

The experiment can evolve without changing the original profile.

This separation makes it possible to change future behavior from inside any current Codex conversation without retroactively moving unrelated conversations.

Evidence you can trust

Evidence

What it proves

Runtime identity?

configured

A validated profile selected the route.

No

route_requested

A spawn_agent call reached the pre-tool hook.

No

route_accepted

Codex accepted the route or returned an agent id.

Not yet

hook_observed

A lifecycle hook mechanically reported the active model slug.

Yes

failed

The route or stage failed.

Failure state

Evidence never moves backward. A late acceptance event cannot replace an earlier hook observation, and agent self-identification is never treated as proof.

Observe versus strict

Mode

Mismatched launch

Recommended use

observe

Records the mismatch and allows Codex to continue.

Initial setup, experimentation, and compatibility testing.

strict

Denies a mismatched spawn_agent call.

Stable, audited profiles where exact routing matters.

Strict matching checks every configured routing field. It cannot rewrite a tool call, so the root must pass the exact route. Route verification errors remain fail-open by default; advanced users may set STAGE_ORCHESTRATOR_FAIL_CLOSED=1 after validating local state.

Privacy and local state

By default, state lives at $CODEX_HOME/stage-orchestrator or ~/.codex/stage-orchestrator. Set STAGE_ORCHESTRATOR_DATA_DIR to isolate it.

Stored:

  • Profiles, stage mappings, and routing fields.

  • Task/session ids, working directory, agent ids, and timestamps.

  • Stage transitions and hook-reported model slugs.

  • A small capped evidence and event history.

Never read or stored:

  • Transcript contents or transcript paths.

  • Prompt bodies or agent task packets.

  • Agent messages, generated work, or final answers.

  • Shell commands, patches, file contents, browser data, or unrelated tool inputs.

Files use private permissions where supported. Writes are atomic, session filenames are hashed, and cross-process locks protect concurrent hook/MCP updates. See Security.

Product boundaries

  • No in-place root-model hot swap; specialization uses bounded subagents.

  • No native badge injected into the Codex task header in version 0.1.

  • No macOS menu-bar application.

  • Live status appears through lifecycle state, MCP results, Codex agent surfaces, and concise orchestration commentary.

  • The model catalog is host-owned; configured ids are validated only as strings until Codex accepts or observes them.

  • Hook trust and a new task are required for runtime evidence after installation.

These constraints are explicit so the plugin remains honest across Codex hosts. A future MCP App can provide a richer visual surface over the same evidence ledger without changing its trust semantics.

Development

The runtime has no third-party package dependencies.

npm ci --ignore-scripts
npm run check

Validation covers profile schemas, persistence, current/future scope, strict enforcement, evidence monotonicity, runtime mismatches, hook privacy, cross-process locking, MCP stdio, and package structure. CI runs on Ubuntu, macOS, and Windows with supported Node.js versions.

Repository layout:

plugins/codex-stage-orchestrator/  Plugin manifest, MCP server, hooks, skill
examples/profiles/                 Generic example profiles
docs/                              Architecture, protocol, and Spanish guide
test/                              Node test suite
.agents/plugins/marketplace.json   Git-backed Codex marketplace catalog

Contributing and support

Contributions are welcome. Please read Contributing and the Code of Conduct, search existing issues, and include tests for protocol or persistence changes.

Roadmap

  • Gather compatibility evidence across Codex desktop and CLI releases.

  • Add import/export for profiles with explicit review.

  • Explore an optional MCP App status view where supported.

  • Stabilize the state migration contract for 1.0.

  • Submit to the public Plugins Directory after real-world validation.

License

MIT © 2026 Stage Orchestrator Contributors.

A
license - permissive license
-
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    An MCP server that turns independent AI agents into a coordinated engineering team with shared task board, context, review loop, and enforced plan-implement-review-iterate workflow.
    Last updated
    24
    MIT
  • -
    license
    -
    quality
    C
    maintenance
    An MCP server implementing a multi-phase backend for structured model interactions, bounded compilation, exact-hash confirmation, and Codex-run provenance, with trust-separation hardening.
    Last updated
    1
  • A
    license
    -
    quality
    D
    maintenance
    MCP server that enables Claude Code to delegate tasks to Codex for real-time collaborative code generation and execution.
    Last updated
    6
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    A local MCP control plane for Codex that manages task queues, dynamic roles, and side-panel team collaboration with persistence, dependency gating, and structured reporting.
    Last updated
    MIT

View all related MCP servers

Related MCP Connectors

  • A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage

  • Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/slegarraga/codex-stage-orchestrator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server