Skip to content

feat: support multiple agent types (claude, codex, gemini, opencode)#93

Merged
jedipunkz merged 11 commits into
mainfrom
feat/support-multi-agents
May 1, 2026
Merged

feat: support multiple agent types (claude, codex, gemini, opencode)#93
jedipunkz merged 11 commits into
mainfrom
feat/support-multi-agents

Conversation

@jedipunkz
Copy link
Copy Markdown
Owner

Why

  • ax agent new was hard-coded to launch claude only, making it impossible to use other AI coding agents within the ax workflow
  • Users wanted to manage codex, gemini, and opencode sessions with the same worktree and state tracking that ax provides

What

  • Add optional [agent-type] positional argument to ax agent new — defaults to claude for backward compatibility
    • Example: ax agent new codex -n my-task
  • Add AgentType field to AgentState (persisted in ~/.ax/state.json with omitempty for backward compatibility)
  • ax agent resume now uses agent-specific resume arguments per tool:
    • claude--resume
    • gemini--resume latest (requires v0.20.0+)
    • codexresume --last
    • opencode--continue
    • unknown types → launch fresh in existing worktree
  • ax agent resume also accepts [agent-type] as first positional arg to override the stored type
  • TUI dashboard (ax dash) shows an "Agent:" row in the overview panel
  • Input validation: agent type must be a plain binary name (no path separators or spaces)
  • AgentState.AgentTypeName() centralizes the "claude" default fallback
  • Table-driven tests for parseAgentTypeAndNameFlag and resumePrefixArgs

Reference

  • N/A

- 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.
@jedipunkz jedipunkz merged commit 3017a2e into main May 1, 2026
2 checks passed
@jedipunkz jedipunkz deleted the feat/support-multi-agents branch May 1, 2026 06:21
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