Skip to content

codex:codex-rescue agent times out before Codex task completes on large diffs #122

Open

Description

@Anfed-2030

Description

When using codex:codex-rescue subagents to dispatch review tasks via the codex-companion.mjs task command, the agent's Bash call times out (300s) before Codex finishes its analysis on large diffs. The Codex task continues running in the background, but the agent returns empty-handed and the results are never delivered to the parent conversation.

Reproduction

  1. Dispatch a review task via codex:codex-rescue on a diff with 30+ files / ~2000 lines
  2. Codex starts a thorough multi-pass analysis (44+ file reads observed)
  3. The codex-companion.mjs task command blocks waiting for Codex to finish
  4. After 300 seconds, the Bash timeout in the Claude Code agent fires
  5. The agent returns with "task dispatched, running in background" — no results
  6. Codex eventually finishes, but the verdict sits in the job log with no way to surface it back

Observed behavior

The Codex task log shows active work throughout:

[codex] Assistant message captured: I'm separating "new bug introduced by the branch" from "pre-existing path...
[codex] Command completed: git show '...:lib/training/workout-lifecycle.ts' (exit 0)
[codex] Command completed: git grep -n "deleted_at" ... (exit 0)
... (44+ commands executed)

But the agent that dispatched it has already returned empty.

Expected behavior

One of:

  1. Streaming partial results — the companion script could stream findings as they're discovered, so the agent can return intermediate results before timeout
  2. Async result retrieval — the companion script could return a job ID immediately, and provide a codex-companion.mjs result <job-id> command that the agent can poll
  3. Configurable timeout — allow the agent or companion script to set a longer timeout for large diffs
  4. Automatic result callback — when the task completes, write results to a known location that the parent session can detect

Impact

For small diffs (1-5 files), Codex completes within the timeout and results are returned normally. For larger diffs (30+ files), Codex reviews are effectively lost — the analysis runs but nobody sees the output. This makes Codex unreliable as a review gate for substantial PRs, which are exactly the ones that benefit most from a second opinion.

Environment

  • macOS Darwin 25.3.0
  • Node.js v20.19.6
  • Plugin version: 1.0.2 (commit 8e403f9)
  • Claude Code v2.1.90
  • Bash timeout: 300,000ms (5 minutes)

Activity

  1. ariccio commented on Apr 3, 2026

    @ariccio

    Came here to the plugin repo to report this too.

    The plugins/codex/agents/codex-rescue.md agent, or the plugins/codex/skills/codex-cli-runtime/SKILL.md skill may benefit from explicit guidance about running with longer timeout: parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions