Cannot match session if Codex session file created more than 3 mins after the Codex process started
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
- Run agent start --type codex.
- Leave the Codex process idle at the prompt for more than 3 minutes before sending the first message.
- Send a message.
- 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.