Repository navigation
Description
Motivation
Callers currently need to know the target agent before discovery: session-peer list defaults to Claude, and Codex requires --agent codex. This makes cross-agent session selection require separate commands.
In v0.7.0, Codex session rows already contain agent: "codex", while Claude rows have no agent discriminator. A unified result should identify each row without requiring callers to infer its agent from fields such as UUID or PID.
Proposed behaviour
- Make
session-peer listandsession-peer list --jsondiscover Claude and Codex together by default. - Include a required
agent: "codex" | "claude"discriminator in every JSON session row. - Retain
--agent codexand--agent claudeas optional filters. - Show an
AGENTcolumn in human-readable output so human and JSON discovery cover the same agents. - Preserve successful session results when another agent's discovery fails, and expose the incomplete discovery explicitly through diagnostics and documented exit-code behaviour.
- Keep the existing schema-versioned JSON envelope and single-host/multi-host object-versus-array convention.
- Preserve each agent's existing identifiers, discovery limits, and
--allsemantics. Combined discovery must not infer a running Codex session from a saved thread or claim message consumption.
Example JSON payload within the existing envelope:
{
"sessions": [
{"agent": "codex", "id": "...", "name": "ontology"},
{"agent": "claude", "pid": 12345, "name": "api-worker"}
]
}Commands:
session-peer list --json # Claude + Codex
session-peer list --agent codex --json # Codex only
session-peer list --agent claude --json # Claude onlyCompatibility
The default changes from Claude-only to combined discovery. Document this behaviour change and show existing Claude-only callers how to retain their selection with --agent claude. Agent-specific fields remain available alongside the shared discriminator.
A missing Codex home/state DB on a Claude-only machine must not hide Claude results or appear as a successful complete discovery. Likewise, a Claude inspection failure must not discard successfully discovered Codex rows.
Acceptance criteria
- Default local and SSH listing returns both agents when available.
- Every session row contains the correct agent discriminator.
- Explicit agent filters preserve the corresponding existing discovery behaviour.
- Human-readable output clearly identifies each agent.
- Partial failures preserve successful rows and distinguish incomplete discovery from a complete empty result.
- Local, SSH, and repeated-host responses preserve the existing JSON envelope/cardinality contract.
- Tests cover both agents, one agent installed, neither available, partial failures, filters,
--all, and Codex-home options. - README, JSON documentation, CLI help, and bundled skill examples describe the new default and compatibility guidance.
Related: #29 (JSON envelope), #44 (Codex discovery), #47 (future agent adapters).
Activity