Repository navigation
Add PTY agents (Claude Code, Gemini, Codex) to AI Chat model selector - #1623
Conversation
The model selector had only a generic "Agent CLI" entry (issue #1489) that set provider: 'pty' with no model — the specific harness was chosen inside AiChatPtySession afterward. This adds a "PTY Agents" section sourced from agentStore.availableAgents, listing each detected agent (Claude Code, Gemini CLI, Codex, ...) individually. Unavailable agents render disabled rather than hidden so users can see what's installed. Selecting an agent writes provider: 'pty' with modelId set to the agent id directly, and AiChatPtySession now pre-selects that agent in its launch config instead of always defaulting to Claude Code. Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis PR replaces the generic "Launch agent session…" PTY entry point with a per-agent "PTY Agents" section in the model selector, sourced from However, tracing the data source the new UI depends on ( The change is a net positive over the status quo (a single opaque "Launch agent session…" entry) for the code paths it touches directly (type threading, node-viewer routing, PTY-session pre-selection), and the plumbing is correct and will "just work" the moment FindingsCritical Issues
Suggested Improvements
Nitpicks
Testing
RecommendationRequest changes. The code that was written is clean, well-tested, and correctly threads the PTY agent id through node persistence and pre-selection (AC 4, 5, 6 are genuinely satisfied). But the feature's headline behavior — PTY agents appearing as selectable options in the model dropdown — does not occur in the real app because it's built on |
malibio
left a comment
There was a problem hiding this comment.
Review recommendation: REQUEST CHANGES (GitHub blocks formal 'request changes' review on one's own PR — recorded here instead). See the full review posted as a PR comment above for details: the PTY-agent list added to the model selector is sourced from agentStore, whose ACP path (acpRefreshAgents) is a hardcoded stub returning [] with no backing Tauri/gRPC command, so the new 'PTY Agents' section will not render in the real app — only with mock dev data. Recommend wiring to the existing check_agent_availability RPC (already used by AiChatPtySession) before merge, or explicitly rescoping this PR.
agentStore.refreshAgents() sourced ACP agents from acpRefreshAgents(), a permanent stub returning [] — no acp_refresh_agents command is registered anywhere in src-tauri or the daemon. In a real Tauri build this meant agentStore.agents only ever held local model entries, so the "PTY Agents" section added in the previous commit could never render for real users. Switch to ptyCheckAgentAvailability() (check_agent_availability), the RPC AiChatPtySession's own config screen already uses successfully, mapping each daemon-reported agent (binary + auth found/missing) to an AcpAgentInfo. Also derives availablePtyAgents from agentStore.availableAgents rather than re-filtering .agents locally, matching issue #1450's acceptance criterion that agent detection reads from that getter. Addresses pragmatic-code-review feedback on PR #1623. Co-Authored-By: Claude <[email protected]>
Address Review SummaryDecision: Addressed the Critical finding directly (commit fb96442) rather than delegating — the fix was already scoped and understood while writing this reply. ✅ Addressed
⏭️ Skipped
Testing
Re-Review DecisionDecision: RE-REVIEW NEEDED Rationale: The Critical finding was addressed with a real architectural change — swapping the data source an entire UI section depends on (from a dead stub to a live RPC) and changing the shape/derivation of |
Code Review Summary (Re-Review — delta only,
|
malibio
left a comment
There was a problem hiding this comment.
Re-review recommendation: APPROVE (GitHub blocks formal approval on one's own PR — recorded here instead). See full report posted as a PR comment above: the follow-up commit (fb96442) correctly replaces the dead acpRefreshAgents() stub with the real check_agent_availability RPC, field mapping verified correct, no downstream regressions, 26/26 targeted tests + quality:check clean.
Closes #1450