feat: support multiple agent types (claude, codex, gemini, opencode)#93
Merged
Conversation
- Add AgentState.AgentTypeName() to centralize default fallback logic - Remove duplicated empty-check in runner.go and tui/list.go - Validate agentType in parseAgentTypeAndNameFlag (no path separators or spaces) - Add error return to parseAgentTypeAndNameFlag for invalid input - Fix PTY start comment: 'claude' -> 'agent' - Add table-driven tests for parseAgentTypeAndNameFlag (13 cases)
Each agent CLI has a different interface for session continuation: - claude/gemini: --resume - codex: resume --last - opencode: --continue - unknown types: no prefix (launch fresh in existing worktree)
parseAgentTypeAndNameFlag now returns "" when no agent type is given. ResumeByIDOrName uses stored agent type unless an explicit override is passed. agentResumeCmd uses parseAgentTypeAndNameFlag so positional agent-type arg (e.g. ax agent resume codex -n foo) is consumed instead of forwarded to the binary.
gemini 0.11.2 has no session resume flag; it launches fresh in the existing worktree instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ax agent newwas hard-coded to launchclaudeonly, making it impossible to use other AI coding agents within the ax workflowWhat
[agent-type]positional argument toax agent new— defaults toclaudefor backward compatibilityax agent new codex -n my-taskAgentTypefield toAgentState(persisted in~/.ax/state.jsonwithomitemptyfor backward compatibility)ax agent resumenow uses agent-specific resume arguments per tool:claude→--resumegemini→--resume latest(requires v0.20.0+)codex→resume --lastopencode→--continueax agent resumealso accepts[agent-type]as first positional arg to override the stored typeax dash) shows an "Agent:" row in the overview panelAgentState.AgentTypeName()centralizes the"claude"default fallbackparseAgentTypeAndNameFlagandresumePrefixArgsReference