Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Codex child rows lose answer text and tool counts #11777

ClosedBirzool(GitHub profile, opens in a new tab) opened this issue 1 comment

Area

The Codex provider in apps/server. The bug appears in the web and desktop Agents panel.

Steps to reproduce

  1. Open a Codex thread and ask it to spawn a native child with a readable task name.
  2. Ask the child to read a file and return a short answer.
  3. Check its Agents panel row during the task and after the child becomes idle.

Expected behavior

The row shows the current operation, then the child's answer. It also shows the number of tool calls.

Proposed appearance

These previews use T3's existing row component, fonts, icons, and spacing. The data is synthetic. The proposed code does not yet supply every field shown here.

During work

Agent row during work with its task, role, current operation, model, effort, tokens, and tool count

After the turn

Agent row after the turn with its final message and usage totals

Actual behavior

The row shows assistant message after the child finishes. It shows tokens but no tool count. The child journal contains an answer and tool calls.

At commit ec5ede5e, the collabAgent/item mapping reads command, title, or query for its summary. It ignores agentMessage.text, so an answer becomes a generic item label. Neither this mapping nor the token usage mapping supplies typedUsage.toolUses. AgentsPanel.tsx already displays answer text and tool counts when it receives them.

Version and environment

I reproduced this in T3 Code Alpha 0.0.40 on macOS with Codex CLI 0.154.0. I checked the source at ec5ede5e6a1f2f9d564a5834462f47d1b7e5f0ec.

Impact

Users must leave the Agents panel to read the child's answer or count its tool calls.

#10185 covers missing model and effort labels. The richer panel used as a reference ran a Claude agent. It does not show that this Codex behavior worked before.

The proposed changes restore message text, describe tool operations, and retry startup metadata reads. They do not yet count tools across restarts or store the final answer separately from progress text. Discussion #11778 describes the remaining work.

An adapter test reproduces the text loss and passes with the change. I have not tested the modified build in the live interface. I left the installed application and its databases unchanged.

  1. Triage

    Valid Codex bug, separate from #10185. Native child rows already appear in the Agents panel; the activity line and tool count are lost in the Codex mapping, not in the panel.

    This is not a wash of #10185 (model/effort labels only; that screenshot already showed assistant message as a side effect), #8499 (rows missing entirely), #5793 (inherited parent token totals), #5953 (child output flooding the parent chat), or #9892 (Grok). Discussion #11778 is the broader five-field proposal, not a duplicate of this report. No open/merged PR Closes/Fixes this issue.

    What the code does today

    Confirmed on current main (f328db30). CodexAdapter.ts, AgentsPanel.tsx, and subagentRuntime.ts are unchanged since the pinned base ec5ede5e.

    CodexSessionRuntime forwards child item/started / item/completed as collabAgent/item with the raw item, including agentMessage.text. mapCollabAgentEvent then builds the child summary from only command, title, or query. Assistant messages therefore fall back to the canonical type name: agentMessage → assistant_message → "assistant message".

    The parent item path already uses itemDetail(), which reads text. The child path does not.

    collabAgent/tokenUsage maps token fields only and never sets typedUsage.toolUses. The Codex generated schema has no tool-use aggregate. Claude already supplies toolUses on the same shared contract.

    AgentsPanel is doing the right thing: idle rows show result ?? progress, and the tool chip renders only when usage.toolUses is present. Codex children also settle as idle via task.updated, not task.completed, so a final answer cannot become a durable result today (TaskUpdatedPayload has no result field).

    That matches the report: completed child activity reads assistant message, tokens appear, tool counts do not.

    Suggested fix

    Keep the panel and shared client fold. Fix the Codex adapter first:

    1. Reuse itemDetail / itemTitle (or at least read item.text) when mapping collabAgent/item. Skip empty assistant-message starts so they do not erase a useful operation line. Adapter tests can lock the "assistant message" fallback.
    2. Count unique child tool calls with durable, replay-safe identity (or consume an authoritative provider aggregate if one exists). Persist a complete usage snapshot so a later tool update cannot wipe tokens. An in-memory set is not enough across restart.
    3. Treat phase-aware result persistence as a follow-up. Codex children must stay resumable (idle, not terminal). That likely needs an optional result on the nonterminal update contract plus ingestion/client retention. Track that in #11778 rather than blocking the text-mapping fix.

    The linked candidate (https://github.com/Birzool/t3code/compare/ec5ede5e6a1f2f9d564a5834462f47d1b7e5f0ec...8639397dbf85a5b24eadb030d936155dd711f72f) addresses text/operation summaries and metadata recovery. It does not implement durable tool counting or phase-aware result persistence, so it is not a complete fix for this issue.

    Surfaces: web + desktop Agents panel. Provider-specific to Codex.

  2. juliusmarminge added labelsbug

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

  5. Birzool(GitHub profile, opens in a new tab) changed the title

  6. juliusmarminge closed this

Sign in to join this conversation.