Skip to content

Codex subagent: crash on empty responses + streaming parser not capturing output #5

@brandontan

Description

@brandontan

Summary

Two issues with the Codex subagent in roundtable-ai v0.8.0:

Bug 1: list index out of range crash (easy fix)

server.py line 448 accesses agent_responses[-1] without checking if the list is empty:

# BUGGY (line 448)
final_response = summary if config.verbose else agent_responses[-1]

The other three agents (Claude, Cursor, Gemini) already have the guard:

# SAFE — used by claude_subagent, cursor_subagent, gemini_subagent
final_response = summary if config.verbose else (agent_responses[-1] if agent_responses else summary)

Fix: Add the same empty-list guard to the Codex path.

Bug 2: Streaming parser captures zero messages from Codex CLI v0.101.0

After fixing Bug 1, the Codex subagent no longer crashes but returns:

✅ Codex task completed successfully (no detailed output captured)

Meanwhile, running codex exec directly in the same directory works perfectly and returns a response.

The streaming message loop (lines 388–422) checks for message.role == "assistant" and other attributes, but none of the streamed messages from Codex CLI v0.101.0 match these conditions. The agent_responses list stays empty.

This suggests CodexCLI.execute_with_streaming() (from claudable_helper) returns messages in a format that doesn't match the categorization logic in server.py.

Environment

  • roundtable-ai: 0.8.0
  • codex-cli: 0.101.0
  • macOS (Darwin 25.2.0, Apple Silicon)
  • Python 3.11

Steps to Reproduce

  1. Install roundtable-ai v0.8.0 with Codex enabled
  2. Call codex_subagent with any simple instruction
  3. Bug 1: Observe list index out of range error
  4. After patching line 448, Bug 2: Observe empty "no detailed output captured" response

Expected Behavior

Codex subagent should return the actual response from Codex CLI, similar to how Claude and Gemini subagents work.

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