ai-devkit
ai-devkit copied to clipboard
fix(agent-manager): non-agent codex helper processes (app-server, sandbox) are listed as running agents
Problem
CodexAdapter.canHandle accepts any process whose executable basename is codex. That includes Codex processes that aren't interactive agents, such as:
- the Codex app-server daemon (
.../app-server-daemon/.../bin/codex); codex app-server --listen stdio://;codex sandbox ...helpers started by desktop apps that bundle Codex.
These show up in ai-devkit agent list and the console as running agents with no session.
Because they never match a session, they also go through the date-window discovery scan on every refresh (see #258), so they add a permanent cost as well as being wrong.
Evidence
- On a test machine, 6 of 21 detected "Codex agents" were these helper processes, listed as
runningwith no session file.
Proposed approach
Reject non-interactive subcommands and helper binaries in canHandle or process filtering:
- the first argument is
app-server,sandbox,mcp-serveror a similar helper subcommand; - the executable path is under an app-server-daemon install directory.
Keep interactive codex, codex resume <id>, and other agent entry points that are supported today.
Acceptance criteria
- [ ] Commands
codex app-server ...,codex sandbox ...and the app-server-daemon binary aren't detected as agents (unit tests using real command-line shapes). - [ ] Interactive
codex,codex resume <uuid>, and paths currently detected keep working (existing tests plus new positive cases). - [ ] Excluded processes don't trigger Codex session discovery (a test asserts no locator scan for them).
- [ ]
ai-devkit agent listno longer shows sessionlessrunningentries for these helpers.