Skip to main content
Glama
songzhifei512

multi-agent-bridge

run_codex

Run Codex CLI asynchronously for batch code generation or patch tasks, with automatic retries on rate limits and session resumption for continued context.

Instructions

Async call Codex CLI (codex exec) to run a task. For batch codegen/patches. Non-blocking. Auto-tracks task. Pass session_id to resume a prior Codex session (preserves context); the new session id is captured from output and returned for later resumption. Retries automatically on 429/rate-limit/timeout with exponential backoff (default 2 retries, 3 total attempts); set max_retries=0 to disable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoNo
modelNo
promptYes
task_idNo
workdirNo
reasoningNocodex reasoning effort override, e.g. 'low' (default) / 'medium' / 'high'. low suppresses <PROVIDER> 429 for real long tasks.
session_idNo
max_retriesNoMax retries after the first attempt on 429/timeout (0-5, default 2). 0 = fail on first error.
timeout_secNo
fork_on_failNo A 失败自动 fork:真失败时把任务父标记 superseded 并生成备选子任务给此 agent 承接(仅对属于工作流的任务,≤3 演进上限)。传备选 agent 名(codex/claude/qwen/dsh/opencode)即启用;不传则不自动 fork。
retry_max_msNoCap on backoff delay in ms (default 30000).
capture_traceNo 捕获本次任务的完整推理 step 流(含中间日志/思考)存 task.trace。默认 false(省存储)。
retry_base_msNoBase backoff delay in ms (default 2000). Honors Retry-After if the CLI surfaces one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It transparently explains async non-blocking behavior, automatic retries with exponential backoff on 429/rate-limit/timeout, session resumption semantics, and that the new session id is captured and returned. It also notes max_retries=0 to disable retries. This is substantial context, though it does not disclose return value structure or file-modification side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is tight and efficient, with each clause carrying distinct information: purpose, async nature, session resumption, and retry behavior. It front-loads the action and then layers key details without redundancy. No filler or unnecessary text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 13 parameters, no annotations, and no output schema, the description could offer more on how task tracking works (e.g., role of task_id, how to check status) and what the return payload contains. It covers the most important behavioral aspects (async, retries, session resumption) well, but leaves workflow integration details to sibling tools and some parameters ambiguous.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 46%, so the description must compensate. It adds meaningful semantics for session_id (resume prior session, new id returned) and max_retries (default 2 retries, 3 total attempts, 0 disables), and indirectly clarifies retry_base_ms/retry_max_ms by describing exponential backoff. However, several parameters (prompt, task_id, workdir, model, auto, timeout_sec) are not explained in the description, leaving gaps that the low schema coverage cannot fill.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Async call Codex CLI (codex exec) to run a task.' It further scopes the tool to 'batch codegen/patches' and emphasizes 'Non-blocking', which clearly distinguishes it from sibling tools like run_claude, run_qwen, and run_dsh. An agent can tell exactly what this tool does and when it is the right choice.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'For batch codegen/patches' and highlights 'Non-blocking' and 'Async', which gives clear context for when to use this tool. However, it does not explicitly name alternative tools or state when not to use it, so it lacks a full exclusionary guideline but still provides strong usage signals.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.