m4ru1/codex-fleet

Delegate coding tasks asynchronously from Antigravity to configurable local or remote Codex agents, monitor their real-time event stream in the right-side Fleet panel, poll progress periodically in the main session, receive completion messages back in the main conversation, and manage agent lifecycles (close, archive, and resume). Use whenever the user asks to delegate work to Codex, inspect Codex agent progress, resume a closed Codex session, or configure Codex Fleet backends.

Qu'est-ce que codex-fleet ?

codex-fleet is a Codex agent skill that delegate coding tasks asynchronously from Antigravity to configurable local or remote Codex agents, monitor their real-time event stream in the right-side Fleet panel, poll progress periodically in the main session, receive completion messages back in the main conversation, and manage agent lifecycles (close, archive, and resume). Use whenever the user asks to delegate work to Codex, inspect Codex agent progress, resume a closed Codex session, or configure Codex Fleet backends.

Compatible avec~Claude Code✓Codex CLI~Cursor✓Antigravity✓Gemini CLI
npx skills add https://github.com/m4ru1/codex-fleet/tree/HEAD/skills/codex-fleet

Installed? Explore more Développement et programmation skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Demander à votre IA préférée

Ouvre une nouvelle conversation avec cette compétence d'agent déjà préchargée.

Documentation

Codex Fleet — Antigravity × Codex Delegation Guide

Codex Fleet turns Antigravity into the orchestrator (task decomposition, scoping, delegation, and acceptance review) while one or more configurable Codex agents run development work asynchronously and stream their live activity into a right-side Codex Fleet panel.


1. Core Capabilities & Architecture

  • Configurable, decoupled backend (not tied to a single local Codex install):
    • local-app-server (default): spawns any configured codex binary (command, codexHome, codexProfile, env) via codex app-server --listen stdio://.
    • remote-app-server: connects to a remote Codex App Server over ws://, wss://, or unix:// with optional Bearer token env var.
    • local-exec: compatibility fallback for older Codex CLI versions (codex exec --json).
  • Dual right-side Fleet panel surfaces reading the exact same shared daemon state:
    • Sidecar Panel (SIDECAR_UI_ENTRYPOINT_AUX_PANE): automatically receives window.sidecar.conversationId from Antigravity Desktop and switches tasks automatically when you switch conversations. Open via Overview > Plugins > Codex Fleet or a [Codex Fleet](sidecar://codex-fleet/fleet-panel/) pill.
    • MCP App Panel (aux_pane & global): opened via codex_open_panel, works even when sidecars are disabled, renders the same live Fleet UI, and updates in place.
  • Strict (model, reasoning_effort) validation: checks live model/list before starting a thread and monitors model/rerouted at runtime — refuses silent fallback and returns exact supported combinations on error.
  • Completion messaging back to the main conversation: when a Codex agent finishes, fails, or requests input (awaiting_input), the Fleet daemon delivers a structured report directly to the owning Antigravity conversation via agentapi send-message (and the panel also provides a manual Send to Chat button).
  • Resource-friendly lifecycle: Close (unload thread & reclaim idle Codex worker process), Archive (archive thread in Codex & hide from active roster), and Resume (restore any closed/archived Codex session with full context intact).

2. Standard Delegation Workflow (For the Main Antigravity Agent)

Step A — Discover available models & efforts (when needed)

If the user asks for available options, or before guessing a model/effort:

codex_discover()

This returns the active profile, live account models, default model/effort, and exact supportedReasoningEfforts per model.

Step B — Dispatch asynchronously (Fast-Dispatch Principle)

Keep the main session lightweight: read only the minimal files needed to scope the task, and dispatch multiple independent tasks in parallel in a single turn with codex_delegate_start. Do not spend main-session turns pre-debugging target repo build/runtime environments (e.g. missing compiled .so extensions or Python version overlays) — include a 1-line fallback instruction in prompt and let Codex investigate directly.

Call codex_delegate_start with a clear, scoped brief:

  • prompt: Clear, self-contained development or research task description.
  • cwd: Absolute path to the target git repository / workspace.
  • task_type: "research" (investigation, codebase analysis, independent verification, review) or "development" (coding, refactoring, bug fixes, tests; default).
    • Applies the user's configured taskPresets.research / taskPresets.development from ~/.gemini/antigravity/codex-fleet/config.json.
    • Factory defaults: account default model & effort, sandbox="read-only" for research, sandbox="workspace-write" for development (customizable via ⚙ Config or codex_fleet_config).
  • allowed_scope: Explicit list of allowed files/directories Codex may modify.
  • acceptance_criteria: Required tests and checks Codex must run and pass.
  • model & reasoning_effort: Omit to use the configured task_type preset above, or pass exactly what the user requested (never silently alter them; if codex_delegate_start returns a validation error, report the exact error and valid options to the user). Never create redundant profiles in config.json just to switch models.
  • agent_name: Short descriptive name (e.g. boundary-tests, auth-fix) so multiple concurrent Codex agents are easy to distinguish in the Fleet panel.
  • conversation_id: Auto-injected by the plugin's PreToolUse hook; also pass your current conversation ID explicitly if calling outside hook scope.

Fast Recovery if MCP Returns connection closed

If a plugin hot-reload interrupts the Antigravity stdio MCP pipe (connection closed: calling "tools/call"), do NOT inspect plugin source code, logs, or processes. Retry once; if still closed, immediately use the built-in direct daemon CLI (shares the exact same Fleet Daemon, right-side panel, strict validation, and main-conversation notifications):

node ~/.gemini/config/plugins/codex-fleet/scripts/fleet-cli.mjs start \
  --task-type research --agent-name verify-01 --cwd /path/to/repo \
  --conversation-id "<current-conversation-id>" --prompt "..."

Supported CLI subcommands: discover, start, rerun, status, list, respond, cancel, close, archive, resume, config.

One-Step Model / Preset Switch (codex_delegate_rerun)

When the user wants to switch an existing agent to another task_type, model, or reasoning_effort, do not manually archive, edit profiles, and re-type the brief — call codex_delegate_rerun once:

codex_delegate_rerun(task_id="verify-01", task_type="research", extra_prompt="Focus on static verification if native binaries are missing.")

This strictly validates and launches the new agent first, then automatically archives (or closes) the previous agent.

Immediately after dispatch:

  1. Call codex_open_panel(conversation_id="<current-conversation-id>") (or surface [Codex Fleet](sidecar://codex-fleet/fleet-panel/) if the sidecar is enabled and not yet open) so the right-side Fleet panel displays the live agent card and event stream.
  2. Tell the user the task_id, agent_name, effective model & reasoning_effort, and confirm they can keep conversing while Codex runs.

Step C — Periodic progress polling in the main session

Use Antigravity's built-in schedule tool to poll at the configured interval (poll_interval_seconds returned by codex_delegate_start, default 30 seconds):

schedule(
  DurationSeconds=30,
  TimerCondition="never",
  Prompt="Check Codex task <task_id> via codex_delegate_status(task_id='<task_id>'). If still running, summarize latest activity briefly and schedule the next 30s check. If completed, failed, cancelled, or awaiting_input, stop polling, inspect git diff & tests (or relay the question), and report to the user."
)

Polling stop rules:

  • Stop scheduling further timers as soon as status is completed, failed, cancelled, closed, archived, or awaiting_input.
  • If notification.sent is already true (meaning the Fleet daemon already delivered the completion message back to the main conversation via agentapi send-message), avoid repeating the raw report — go straight to verifying the diff & test results.

Step D — Messaging, Steering, Interrupting, and Extracting Process Results

Every lifecycle tool (codex_delegate_status, codex_delegate_respond, codex_delegate_cancel, codex_delegate_close, codex_delegate_archive, codex_delegate_resume) accepts either the task_id or the agent's agent_name (e.g. lerp-feature):

  • Answer awaiting_input (approval or question):
    codex_delegate_respond(task_id="lerp-feature", decision="accept")   # for approvals
    codex_delegate_respond(task_id="lerp-feature", text="<answer>")     # for user_input
    
  • Steer a running agent mid-turn (without cancelling it):
    codex_delegate_respond(task_id="lerp-feature", action="steer", text="Also cover negative zero.")
    
  • Continue messaging a completed / closed / archived agent (auto-resumes its Codex thread with full history intact):
    codex_delegate_respond(task_id="lerp-feature", text="Add JSDoc comments to lerp() and re-run npm test.")
    
  • Interrupt a running agent (preserves thread & intermediate work so you can inspect or continue later):
    codex_delegate_cancel(task_id="lerp-feature")
    
  • Extract intermediate process results at any time (reasoning summary, plan, intermediate messages, executed commands & outputs, partial file changes & unified diff):
    codex_delegate_status(task_id="lerp-feature", include_diff=true, include_timeline=true)
    

Step E — Acceptance & Verification

Once Codex reports completed:

  1. Call codex_delegate_status(task_id="<task_id>", include_diff=true) to review Codex's final message, command exit codes, and diff.
  2. Independently verify in the repository (git status, git diff, and running the relevant test suite) to confirm scope compliance and passing tests before accepting.

3. Resource Management: Close, Archive, and Resume

Running many concurrent Codex sessions keeps app-server threads loaded in memory. Encourage cleanup once a task is verified:

  • Close (codex_delegate_close): Unloads the thread from Codex (thread/unsubscribe) and immediately terminates idle local codex app-server child processes when no live threads remain. Pass task_id="__idle__" to bulk-close all finished agents in one call.
  • Archive (codex_delegate_archive): Unloads and archives the thread in Codex (thread/archive), moving the agent out of the active roster into the Archived filter tab.
  • Resume (codex_delegate_resume): Restores any closed, archived, completed, failed, or cancelled agent back into the live Fleet via thread/unarchive + thread/resume, preserving its full prior Codex conversation context! You can optionally pass a follow-up prompt and/or validated model / reasoning_effort override.

All three actions are also available as one-click buttons (Close, Archive, Resume, Close Idle) directly inside the right-side Codex Fleet panel.


4. Configuring Local & Remote Codex Backends & Language

You can configure Codex Fleet via the ⚙ Config / 配置 button in the right-side panel, by calling codex_fleet_config(patch={...}), or by editing ~/.gemini/antigravity/codex-fleet/config.json:

  • language: "auto" (follow system/host locale), "zh-CN" (Simplified Chinese), or "en" (English). Applies to both the right-side Fleet panel and completion reports sent back to the main Antigravity conversation.
  • taskPresets: Default model, reasoningEffort, and sandbox per task type (research factory default: account default / read-only; development factory default: account default / workspace-write). Customizable in the panel's ⚙ Config / 配置 modal or via codex_fleet_config.

Example: Add a Remote Codex App Server profile

{
  "language": "auto",
  "activeProfile": "remote-workstation",
  "pollIntervalSeconds": 20,
  "maxActiveAgents": 4,
  "strictModelValidation": true,
  "autoNotifyMainConversation": true,
  "autoReclaimIdleProcess": true,
  "profiles": {
    "remote-workstation": {
      "label": "Remote GPU Devbox",
      "transport": "remote-app-server",
      "remoteUrl": "ws://10.0.0.12:4500",
      "authTokenEnv": "CODEX_REMOTE_TOKEN",
      "defaultSandbox": "workspace-write",
      "defaultApprovalPolicy": "never"
    }
  }
}

Example: Add a Secondary Local Codex Account / Custom Binary

{
  "profiles": {
    "work-codex": {
      "label": "Work Account Codex",
      "transport": "local-app-server",
      "command": "/usr/local/bin/codex",
      "codexHome": "/Users/you/.codex-work",
      "defaultModel": "gpt-6.1-terra",
      "defaultReasoningEffort": "high"
    }
  }
}

5. MCP Tool Quick Reference

ToolPurpose
codex_discoverQuery live models & supported reasoning_effort values from the active profile
codex_delegate_startStart an async Codex task with strict (model, reasoning_effort) validation
codex_delegate_statusRead live status, events, commands, diff stats, and effective config
codex_delegate_respondAnswer awaiting_input, approve/decline requests, steer running turn, or follow up
codex_delegate_cancelInterrupt a running turn cleanly
codex_delegate_closeUnload thread & reclaim idle worker process (preserves thread for resume)
codex_delegate_archiveArchive thread & hide from active fleet (preserves thread for resume)
codex_delegate_resumeRestore a closed/archived/finished Codex session with full context
codex_delegate_rerunRe-run an existing task in one step with a new task_type, model, reasoning_effort, or extra guidance
codex_delegate_listList agents for the current Antigravity session (or all sessions)
codex_fleet_configRead or patch backend profiles, polling interval, and notification policies
codex_open_panelOpen/refresh the MCP App right-side Fleet panel (aux_pane / global)

Skills associés