Skip to content

feat(agent-manager): registry mirrors live agents#91

Merged
codeaholicguy merged 5 commits into
mainfrom
feature-agent-registry-session-cache
May 31, 2026
Merged

feat(agent-manager): registry mirrors live agents#91
codeaholicguy merged 5 commits into
mainfrom
feature-agent-registry-session-cache

Conversation

@codeaholicguy
Copy link
Copy Markdown
Owner

Summary

  • Make AgentRegistry the source of truth for active agents: AgentManager.listAgents() is now the single writer, batching a registry entry for every detected agent and pruning dead pids in the same call.
  • Persist sessionId + sessionFilePath per entry so cache-using adapters can skip their per-call session discovery walk.
  • Codex and Gemini adapters short-circuit detection by looking up live pids in the registry; Claude and OpenCode keep their existing O(1) lookups (PID file / SQLite) but still get one registry entry written per live process.

Behavior

  • One entry per live agent across all adapters after every listAgents() call.
  • User-set names (e.g. "merry"), tmuxSession, and startedAt are preserved across cycles. Other fields refresh from the latest detection.
  • tmuxSession merge rule on upsert: preserve existing non-empty when incoming is empty (auto-upserts from adapters never clobber a value set by agent start or future tmux integration).
  • Pid recycle within the same agent type and same cwd is rare and deferred — accepted trade-off.

@codeaholicguy codeaholicguy merged commit f59710f into main May 31, 2026
7 checks passed
@codeaholicguy codeaholicguy deleted the feature-agent-registry-session-cache branch May 31, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant