ai-devkit icon indicating copy to clipboard operation
ai-devkit copied to clipboard

Cannot match session if Codex session file created more than 3 mins after the Codex process started

Open codeaholicguy opened this issue 5 months ago • 0 comments

Root Cause

agent start --type codex registers the agent before Codex has a session file.

Later, agent list/agent send calls AgentManager.listAgents(), which should enrich agents.json from CodexAdapter. But Codex matching currently requires: abs(process.startTime - session.birthtimeMs) <= 3 minutes

We can still send a message: plain agent send writes to the terminal/TTY and does not need sessionFilePath. But transcript polling, conversation detail, and wait mode need the session file.

Repro

  1. Run agent start --type codex.
  2. Leave the Codex process idle at the prompt for more than 3 minutes before sending the first message.
  3. Send a message.
  4. Run agent list or inspect ~/.ai-devkit/agents.json.

The Codex JSONL file is created late, but its session_meta.payload.timestamp still reflects process/session start. The current matcher ignores that metadata timestamp and uses filesystem birth time.

Fix

Change Codex session matching to use session_meta.payload.timestamp as the matching timestamp when present, falling back to file birthtimeMs.

codeaholicguy avatar Jun 13 '26 10:06 codeaholicguy