Documentation
¶
Index ¶
- Variables
- func AllowUnsafeAgents() bool
- func AnthropicAPIKey() string
- func Available() []string
- func CanonicalName(name string) string
- func IsAvailable(name string) bool
- func ReasoningLevels() []string
- func Register(a Agent)
- func SetAllowUnsafeAgents(allow bool)
- func SetAnthropicAPIKey(key string)
- func Unregister(name string)
- type ACPAgent
- func (a *ACPAgent) CommandLine() string
- func (a *ACPAgent) CommandName() string
- func (a *ACPAgent) Name() string
- func (a *ACPAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *ACPAgent) WithAgentic(agentic bool) Agent
- func (a *ACPAgent) WithModel(model string) Agent
- func (a *ACPAgent) WithReasoning(level ReasoningLevel) Agent
- type Agent
- type ClaudeAgent
- func (a *ClaudeAgent) CommandLine() string
- func (a *ClaudeAgent) CommandName() string
- func (a *ClaudeAgent) Name() string
- func (a *ClaudeAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *ClaudeAgent) WithAgentic(agentic bool) Agent
- func (a *ClaudeAgent) WithModel(model string) Agent
- func (a *ClaudeAgent) WithReasoning(level ReasoningLevel) Agent
- type CodexAgent
- func (a *CodexAgent) CommandLine() string
- func (a *CodexAgent) CommandName() string
- func (a *CodexAgent) Name() string
- func (a *CodexAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *CodexAgent) WithAgentic(agentic bool) Agent
- func (a *CodexAgent) WithModel(model string) Agent
- func (a *CodexAgent) WithReasoning(level ReasoningLevel) Agent
- type CommandAgent
- type CopilotAgent
- func (a *CopilotAgent) CommandLine() string
- func (a *CopilotAgent) CommandName() string
- func (a *CopilotAgent) Name() string
- func (a *CopilotAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *CopilotAgent) WithAgentic(agentic bool) Agent
- func (a *CopilotAgent) WithModel(model string) Agent
- func (a *CopilotAgent) WithReasoning(level ReasoningLevel) Agent
- type CursorAgent
- func (a *CursorAgent) CommandLine() string
- func (a *CursorAgent) CommandName() string
- func (a *CursorAgent) Name() string
- func (a *CursorAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *CursorAgent) WithAgentic(agentic bool) Agent
- func (a *CursorAgent) WithModel(model string) Agent
- func (a *CursorAgent) WithReasoning(level ReasoningLevel) Agent
- type DroidAgent
- func (a *DroidAgent) CommandLine() string
- func (a *DroidAgent) CommandName() string
- func (a *DroidAgent) Name() string
- func (a *DroidAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *DroidAgent) WithAgentic(agentic bool) Agent
- func (a *DroidAgent) WithModel(model string) Agent
- func (a *DroidAgent) WithReasoning(level ReasoningLevel) Agent
- type FailingWriter
- type FakeAgent
- func (a *FakeAgent) CommandLine() string
- func (a *FakeAgent) Name() string
- func (a *FakeAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *FakeAgent) WithAgentic(agentic bool) Agent
- func (a *FakeAgent) WithModel(model string) Agent
- func (a *FakeAgent) WithReasoning(level ReasoningLevel) Agent
- type GeminiAgent
- func (a *GeminiAgent) CommandLine() string
- func (a *GeminiAgent) CommandName() string
- func (a *GeminiAgent) Name() string
- func (a *GeminiAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *GeminiAgent) WithAgentic(agentic bool) Agent
- func (a *GeminiAgent) WithModel(model string) Agent
- func (a *GeminiAgent) WithReasoning(level ReasoningLevel) Agent
- type KiloAgent
- func (a *KiloAgent) CommandLine() string
- func (a *KiloAgent) CommandName() string
- func (a *KiloAgent) Name() string
- func (a *KiloAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *KiloAgent) WithAgentic(agentic bool) Agent
- func (a *KiloAgent) WithModel(model string) Agent
- func (a *KiloAgent) WithReasoning(level ReasoningLevel) Agent
- type KiroAgent
- func (a *KiroAgent) CommandLine() string
- func (a *KiroAgent) CommandName() string
- func (a *KiroAgent) Name() string
- func (a *KiroAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *KiroAgent) WithAgentic(agentic bool) Agent
- func (a *KiroAgent) WithModel(model string) Agent
- func (a *KiroAgent) WithReasoning(level ReasoningLevel) Agent
- type MockCLIOpts
- type MockCLIResult
- type OpenCodeAgent
- func (a *OpenCodeAgent) CommandLine() string
- func (a *OpenCodeAgent) CommandName() string
- func (a *OpenCodeAgent) Name() string
- func (a *OpenCodeAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *OpenCodeAgent) WithAgentic(agentic bool) Agent
- func (a *OpenCodeAgent) WithModel(model string) Agent
- func (a *OpenCodeAgent) WithReasoning(level ReasoningLevel) Agent
- type PiAgent
- func (a *PiAgent) CommandLine() string
- func (a *PiAgent) CommandName() string
- func (a *PiAgent) Name() string
- func (a *PiAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *PiAgent) WithAgentic(agentic bool) Agent
- func (a *PiAgent) WithModel(model string) Agent
- func (a *PiAgent) WithProvider(provider string) Agent
- func (a *PiAgent) WithReasoning(level ReasoningLevel) Agent
- type ReasoningLevel
- type ScriptBuilder
- type TestAgent
- func (a *TestAgent) CommandLine() string
- func (a *TestAgent) Name() string
- func (a *TestAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
- func (a *TestAgent) WithAgentic(agentic bool) Agent
- func (a *TestAgent) WithModel(model string) Agent
- func (a *TestAgent) WithReasoning(level ReasoningLevel) Agent
- type UnknownAgentError
Constants ¶
This section is empty.
Variables ¶
var ErrPathTraversal = errors.New("path traversal attempt detected")
Security error for path traversal attempts
Functions ¶
func AllowUnsafeAgents ¶
func AllowUnsafeAgents() bool
func AnthropicAPIKey ¶
func AnthropicAPIKey() string
AnthropicAPIKey returns the configured Anthropic API key, or empty string if not set
func CanonicalName ¶ added in v0.34.0
CanonicalName resolves an agent alias to its canonical name. Returns the name unchanged if it is not an alias.
func IsAvailable ¶
IsAvailable checks if an agent's command is installed on the system Supports aliases like "claude" for "claude-code"
func ReasoningLevels ¶ added in v0.36.0
func ReasoningLevels() []string
ReasoningLevels returns the canonical reasoning level names.
func SetAllowUnsafeAgents ¶
func SetAllowUnsafeAgents(allow bool)
func SetAnthropicAPIKey ¶
func SetAnthropicAPIKey(key string)
SetAnthropicAPIKey sets the Anthropic API key for Claude Code
func Unregister ¶ added in v0.37.0
func Unregister(name string)
Unregister removes an agent from the registry (useful for testing)
Types ¶
type ACPAgent ¶ added in v0.40.0
type ACPAgent struct {
Command string // ACP agent command (configured via TOML)
Args []string // Additional arguments for the agent
Model string // Model to use
Mode string // Mode to use
ReadOnlyMode string
AutoApproveMode string
Reasoning ReasoningLevel // Reasoning level
Agentic bool // Agentic mode
Timeout time.Duration // Command timeout
SessionId string // Current ACP session ID
// contains filtered or unexported fields
}
ACPAgent runs code reviews using the Agent Client Protocol via acp-go-sdk
func NewACPAgent ¶ added in v0.40.0
func NewACPAgentFromConfig ¶ added in v0.40.0
func NewACPAgentFromConfig(config *config.ACPAgentConfig) *ACPAgent
func (*ACPAgent) CommandLine ¶ added in v0.40.0
func (*ACPAgent) CommandName ¶ added in v0.40.0
func (*ACPAgent) Review ¶ added in v0.40.0
func (a *ACPAgent) Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
Review implements the main review functionality using ACP SDK
func (*ACPAgent) WithAgentic ¶ added in v0.40.0
func (*ACPAgent) WithReasoning ¶ added in v0.40.0
func (a *ACPAgent) WithReasoning(level ReasoningLevel) Agent
type Agent ¶
type Agent interface {
// Name returns the agent identifier (e.g., "codex", "claude-code")
Name() string
// Review runs a code review and returns the output.
// If output is non-nil, agent progress is streamed to it in real-time.
Review(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (result string, err error)
// WithReasoning returns a copy of the agent configured with the specified reasoning level.
// Agents that don't support reasoning levels may return themselves unchanged.
WithReasoning(level ReasoningLevel) Agent
// WithAgentic returns a copy of the agent configured for agentic mode.
// In agentic mode, agents can edit files and run commands.
// If false, agents operate in read-only review mode.
WithAgentic(agentic bool) Agent
// WithModel returns a copy of the agent configured to use the specified model.
// If model is empty, the agent is returned unchanged (preserving any built-in default).
// Agents that don't support model selection may return themselves unchanged.
// For opencode, the model format is "provider/model" (e.g., "anthropic/claude-sonnet-4-20250514").
WithModel(model string) Agent
// CommandLine returns a representative command line for this agent (binary + flags).
// Runtime-specific arguments (repo path, output file, prompt) are excluded.
// Useful for debugging which binary, model, and flags were used.
CommandLine() string
}
Agent defines the interface for code review agents
func GetAvailable ¶
GetAvailable returns an available agent, trying the requested one first, then falling back to alternatives. Returns error only if no agents available. Supports aliases like "claude" for "claude-code".
Optional backup agent names are tried after the preferred agent but before the hardcoded fallback chain. This lets callers honor default_backup_agent config without changing the global chain order.
func GetAvailableWithConfig ¶ added in v0.40.0
GetAvailableWithConfig resolves an available agent while honoring runtime ACP config. It treats cfg.ACP.Name as an alias for "acp" and applies cfg.ACP command/mode/model at resolution time instead of package-init time. It also applies command overrides for other agents (codex, claude, cursor, pi).
Optional backup agent names are tried after the preferred agent but before the hardcoded fallback chain (see GetAvailable).
type ClaudeAgent ¶
type ClaudeAgent struct {
Command string // The claude command to run (default: "claude")
Model string // Model to use (e.g., "opus", "sonnet", or full name)
Reasoning ReasoningLevel // Reasoning level (for future extended thinking support)
Agentic bool // Whether agentic mode is enabled (allow file edits)
}
ClaudeAgent runs code reviews using Claude Code CLI
func NewClaudeAgent ¶
func NewClaudeAgent(command string) *ClaudeAgent
NewClaudeAgent creates a new Claude Code agent
func (*ClaudeAgent) CommandLine ¶ added in v0.28.0
func (a *ClaudeAgent) CommandLine() string
func (*ClaudeAgent) CommandName ¶
func (a *ClaudeAgent) CommandName() string
func (*ClaudeAgent) Name ¶
func (a *ClaudeAgent) Name() string
func (*ClaudeAgent) WithAgentic ¶
func (a *ClaudeAgent) WithAgentic(agentic bool) Agent
WithAgentic returns a copy of the agent configured for agentic mode.
func (*ClaudeAgent) WithModel ¶ added in v0.17.0
func (a *ClaudeAgent) WithModel(model string) Agent
WithModel returns a copy of the agent configured to use the specified model.
func (*ClaudeAgent) WithReasoning ¶
func (a *ClaudeAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent with the model preserved (reasoning not yet supported).
type CodexAgent ¶
type CodexAgent struct {
Command string // The codex command to run (default: "codex")
Model string // Model to use (e.g., "o3", "o4-mini")
Reasoning ReasoningLevel // Reasoning level for the agent
Agentic bool // Whether agentic mode is enabled (allow file edits)
}
CodexAgent runs code reviews using the Codex CLI
func NewCodexAgent ¶
func NewCodexAgent(command string) *CodexAgent
NewCodexAgent creates a new Codex agent with standard reasoning
func (*CodexAgent) CommandLine ¶ added in v0.28.0
func (a *CodexAgent) CommandLine() string
func (*CodexAgent) CommandName ¶
func (a *CodexAgent) CommandName() string
func (*CodexAgent) Name ¶
func (a *CodexAgent) Name() string
func (*CodexAgent) WithAgentic ¶
func (a *CodexAgent) WithAgentic(agentic bool) Agent
WithAgentic returns a copy of the agent configured for agentic mode.
func (*CodexAgent) WithModel ¶ added in v0.17.0
func (a *CodexAgent) WithModel(model string) Agent
WithModel returns a copy of the agent configured to use the specified model.
func (*CodexAgent) WithReasoning ¶
func (a *CodexAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent with the specified reasoning level
type CommandAgent ¶
type CommandAgent interface {
Agent
// CommandName returns the executable command name
CommandName() string
}
CommandAgent is an agent that uses an external command
type CopilotAgent ¶
type CopilotAgent struct {
Command string // The copilot command to run (default: "copilot")
Model string // Model to use
Reasoning ReasoningLevel // Reasoning level (for future support)
Agentic bool // Whether agentic mode is enabled (note: Copilot requires manual approval for actions)
}
CopilotAgent runs code reviews using the GitHub Copilot CLI
func NewCopilotAgent ¶
func NewCopilotAgent(command string) *CopilotAgent
NewCopilotAgent creates a new Copilot agent
func (*CopilotAgent) CommandLine ¶ added in v0.28.0
func (a *CopilotAgent) CommandLine() string
func (*CopilotAgent) CommandName ¶
func (a *CopilotAgent) CommandName() string
func (*CopilotAgent) Name ¶
func (a *CopilotAgent) Name() string
func (*CopilotAgent) WithAgentic ¶
func (a *CopilotAgent) WithAgentic(agentic bool) Agent
WithAgentic returns a copy of the agent configured for agentic mode. Note: Copilot CLI requires manual approval for all actions and does not support automated unsafe execution. The agentic flag is tracked but has no effect on Copilot's behavior.
func (*CopilotAgent) WithModel ¶ added in v0.17.0
func (a *CopilotAgent) WithModel(model string) Agent
WithModel returns a copy of the agent configured to use the specified model.
func (*CopilotAgent) WithReasoning ¶
func (a *CopilotAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent with the model preserved (reasoning not yet supported).
type CursorAgent ¶ added in v0.21.0
type CursorAgent struct {
Command string // The agent command to run (default: "agent")
Model string // Model to use
Reasoning ReasoningLevel // Reasoning level
Agentic bool // Whether agentic mode is enabled
}
CursorAgent runs code reviews using the Cursor agent CLI
func NewCursorAgent ¶ added in v0.21.0
func NewCursorAgent(command string) *CursorAgent
NewCursorAgent creates a new Cursor agent
func (*CursorAgent) CommandLine ¶ added in v0.28.0
func (a *CursorAgent) CommandLine() string
func (*CursorAgent) CommandName ¶ added in v0.21.0
func (a *CursorAgent) CommandName() string
func (*CursorAgent) Name ¶ added in v0.21.0
func (a *CursorAgent) Name() string
func (*CursorAgent) WithAgentic ¶ added in v0.21.0
func (a *CursorAgent) WithAgentic(agentic bool) Agent
func (*CursorAgent) WithModel ¶ added in v0.21.0
func (a *CursorAgent) WithModel(model string) Agent
func (*CursorAgent) WithReasoning ¶ added in v0.21.0
func (a *CursorAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy with the reasoning level stored. The agent CLI has no reasoning flag; callers can map reasoning to model selection instead.
type DroidAgent ¶ added in v0.15.0
type DroidAgent struct {
Command string // The droid command to run (default: "droid")
Reasoning ReasoningLevel // Reasoning level for the agent
Agentic bool // Whether agentic mode is enabled (allow file edits)
}
DroidAgent runs code reviews using Factory's Droid CLI
func NewDroidAgent ¶ added in v0.15.0
func NewDroidAgent(command string) *DroidAgent
NewDroidAgent creates a new Droid agent with standard reasoning
func (*DroidAgent) CommandLine ¶ added in v0.28.0
func (a *DroidAgent) CommandLine() string
func (*DroidAgent) CommandName ¶ added in v0.15.0
func (a *DroidAgent) CommandName() string
func (*DroidAgent) Name ¶ added in v0.15.0
func (a *DroidAgent) Name() string
func (*DroidAgent) WithAgentic ¶ added in v0.15.0
func (a *DroidAgent) WithAgentic(agentic bool) Agent
WithAgentic returns a copy of the agent configured for agentic mode.
func (*DroidAgent) WithModel ¶ added in v0.17.0
func (a *DroidAgent) WithModel(model string) Agent
WithModel returns the agent unchanged (model selection not supported for droid).
func (*DroidAgent) WithReasoning ¶ added in v0.15.0
func (a *DroidAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent with the specified reasoning level
type FailingWriter ¶ added in v0.26.1
type FailingWriter struct {
Err error
}
FailingWriter always returns an error on Write.
type FakeAgent ¶ added in v0.37.0
type FakeAgent struct {
NameStr string
ReviewFn func(ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer) (string, error)
}
FakeAgent implements Agent for testing purposes.
func (*FakeAgent) CommandLine ¶ added in v0.37.0
func (*FakeAgent) WithAgentic ¶ added in v0.37.0
func (*FakeAgent) WithReasoning ¶ added in v0.37.0
func (a *FakeAgent) WithReasoning(level ReasoningLevel) Agent
type GeminiAgent ¶
type GeminiAgent struct {
Command string // The gemini command to run (default: "gemini")
Model string // Model to use (e.g., "gemini-3.1-pro-preview")
Reasoning ReasoningLevel // Reasoning level (for future support)
Agentic bool // Whether agentic mode is enabled (allow file edits)
}
GeminiAgent runs code reviews using the Gemini CLI
func NewGeminiAgent ¶
func NewGeminiAgent(command string) *GeminiAgent
NewGeminiAgent creates a new Gemini agent
func (*GeminiAgent) CommandLine ¶ added in v0.28.0
func (a *GeminiAgent) CommandLine() string
func (*GeminiAgent) CommandName ¶
func (a *GeminiAgent) CommandName() string
func (*GeminiAgent) Name ¶
func (a *GeminiAgent) Name() string
func (*GeminiAgent) WithAgentic ¶
func (a *GeminiAgent) WithAgentic(agentic bool) Agent
WithAgentic returns a copy of the agent configured for agentic mode.
func (*GeminiAgent) WithModel ¶ added in v0.17.0
func (a *GeminiAgent) WithModel(model string) Agent
WithModel returns a copy of the agent configured to use the specified model.
func (*GeminiAgent) WithReasoning ¶
func (a *GeminiAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent with the model preserved (reasoning not yet supported).
type KiloAgent ¶ added in v0.38.0
type KiloAgent struct {
Command string // The kilo command to run (default: "kilo")
Model string // Model to use (provider/model format, e.g., "anthropic/claude-sonnet-4-20250514")
Reasoning ReasoningLevel // Reasoning level mapped to --variant flag
Agentic bool // Whether agentic mode is enabled (uses --auto)
}
KiloAgent runs code reviews using the Kilo CLI (https://kilo.ai). This implementation is intentionally cloned from OpenCodeAgent rather than sharing a base struct, because kilo may drift from opencode in the future.
func NewKiloAgent ¶ added in v0.38.0
NewKiloAgent creates a new Kilo agent
func (*KiloAgent) CommandLine ¶ added in v0.38.0
func (*KiloAgent) CommandName ¶ added in v0.38.0
func (*KiloAgent) Review ¶ added in v0.38.0
func (a *KiloAgent) Review( ctx context.Context, repoPath, commitSHA, prompt string, output io.Writer, ) (string, error)
Review runs kilo with --format json and parses the JSONL stream (same envelope as opencode: {"type":"...","part":{"type":"text","text":"..."}}).
func (*KiloAgent) WithAgentic ¶ added in v0.38.0
func (*KiloAgent) WithReasoning ¶ added in v0.38.0
func (a *KiloAgent) WithReasoning(level ReasoningLevel) Agent
type KiroAgent ¶ added in v0.40.0
type KiroAgent struct {
Command string // The kiro-cli command to run (default: "kiro-cli")
Reasoning ReasoningLevel // Reasoning level (stored; kiro-cli has no reasoning flag)
Agentic bool // Whether agentic mode is enabled (uses --trust-all-tools)
}
KiroAgent runs code reviews using the Kiro CLI (kiro-cli)
func NewKiroAgent ¶ added in v0.40.0
NewKiroAgent creates a new Kiro agent with standard reasoning
func (*KiroAgent) CommandLine ¶ added in v0.40.0
func (*KiroAgent) CommandName ¶ added in v0.40.0
func (*KiroAgent) WithAgentic ¶ added in v0.40.0
WithAgentic returns a copy of the agent configured for agentic mode. In agentic mode, --trust-all-tools is passed so kiro can use tools without confirmation.
func (*KiroAgent) WithModel ¶ added in v0.40.0
WithModel returns the agent unchanged; kiro-cli does not expose a --model CLI flag.
func (*KiroAgent) WithReasoning ¶ added in v0.40.0
func (a *KiroAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy with the reasoning level stored. kiro-cli has no reasoning flag; callers can map reasoning to agent selection instead.
type MockCLIOpts ¶ added in v0.21.0
type MockCLIOpts struct {
HelpOutput string // Output when --help is passed; empty means no --help handling
ExitCode int // Exit code for normal (non-help) invocations
CaptureArgs bool // Write "$@" to a capture file
CaptureStdin bool // Write stdin to a capture file
StdoutLines []string
StderrLines []string
}
MockCLIOpts controls the behavior of a mock agent CLI script.
type MockCLIResult ¶ added in v0.21.0
type MockCLIResult struct {
CmdPath string
ArgsFile string // Non-empty when CaptureArgs was set
StdinFile string // Non-empty when CaptureStdin was set
}
MockCLIResult holds paths to the mock command and any capture files.
type OpenCodeAgent ¶
type OpenCodeAgent struct {
Command string // The opencode command to run (default: "opencode")
Model string // Model to use (provider/model format, e.g., "anthropic/claude-sonnet-4-20250514")
Reasoning ReasoningLevel // Reasoning level (for future support)
Agentic bool // Whether agentic mode is enabled (OpenCode auto-approves in non-interactive mode)
}
OpenCodeAgent runs code reviews using the OpenCode CLI
func NewOpenCodeAgent ¶
func NewOpenCodeAgent(command string) *OpenCodeAgent
NewOpenCodeAgent creates a new OpenCode agent
func (*OpenCodeAgent) CommandLine ¶ added in v0.28.0
func (a *OpenCodeAgent) CommandLine() string
func (*OpenCodeAgent) CommandName ¶
func (a *OpenCodeAgent) CommandName() string
func (*OpenCodeAgent) Name ¶
func (a *OpenCodeAgent) Name() string
func (*OpenCodeAgent) WithAgentic ¶
func (a *OpenCodeAgent) WithAgentic(agentic bool) Agent
WithAgentic returns a copy of the agent configured for agentic mode. Note: OpenCode's `run` command auto-approves all permissions in non-interactive mode, so agentic mode is effectively always enabled when running through roborev.
func (*OpenCodeAgent) WithModel ¶ added in v0.17.0
func (a *OpenCodeAgent) WithModel(model string) Agent
WithModel returns a copy of the agent configured to use the specified model.
func (*OpenCodeAgent) WithReasoning ¶
func (a *OpenCodeAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent with the model preserved (reasoning not yet supported).
type PiAgent ¶ added in v0.42.0
type PiAgent struct {
Command string // The pi command to run (default: "pi")
Model string // Model to use (provider/model format or just model)
Provider string // Explicit provider (optional)
Reasoning ReasoningLevel // Reasoning level
Agentic bool // Agentic mode
}
PiAgent runs code reviews using the pi CLI
func NewPiAgent ¶ added in v0.42.0
NewPiAgent creates a new pi agent
func (*PiAgent) CommandLine ¶ added in v0.42.0
func (*PiAgent) CommandName ¶ added in v0.42.0
func (*PiAgent) WithAgentic ¶ added in v0.42.0
WithAgentic returns a copy of the agent configured for agentic mode.
func (*PiAgent) WithModel ¶ added in v0.42.0
WithModel returns a copy of the agent configured to use the specified model.
func (*PiAgent) WithProvider ¶ added in v0.42.0
WithProvider returns a copy of the agent configured to use the specified provider.
func (*PiAgent) WithReasoning ¶ added in v0.42.0
func (a *PiAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent configured with the specified reasoning level.
type ReasoningLevel ¶
type ReasoningLevel string
ReasoningLevel controls how much reasoning/thinking an agent uses
const ( // ReasoningThorough uses maximum reasoning for deep analysis (slower) ReasoningThorough ReasoningLevel = "thorough" // ReasoningStandard uses balanced reasoning (default) ReasoningStandard ReasoningLevel = "standard" // ReasoningFast uses minimal reasoning for quick responses ReasoningFast ReasoningLevel = "fast" )
func ParseReasoningLevel ¶
func ParseReasoningLevel(s string) ReasoningLevel
ParseReasoningLevel converts a string to ReasoningLevel, defaulting to standard
type ScriptBuilder ¶ added in v0.21.0
type ScriptBuilder struct {
// contains filtered or unexported fields
}
ScriptBuilder helps construct shell scripts for mocking CLI output in tests.
func NewScriptBuilder ¶ added in v0.21.0
func NewScriptBuilder() *ScriptBuilder
NewScriptBuilder creates a new ScriptBuilder with the shebang line.
func (*ScriptBuilder) AddOutput ¶ added in v0.21.0
func (b *ScriptBuilder) AddOutput(s string) *ScriptBuilder
AddOutput adds a line that echoes the given string to stdout.
func (*ScriptBuilder) AddRaw ¶ added in v0.21.0
func (b *ScriptBuilder) AddRaw(line string) *ScriptBuilder
AddRaw adds a raw shell line to the script.
func (*ScriptBuilder) AddToolCall ¶ added in v0.21.0
func (b *ScriptBuilder) AddToolCall(name string, args map[string]any) *ScriptBuilder
AddToolCall adds a line that prints a tool-call JSON object to stdout.
func (*ScriptBuilder) Build ¶ added in v0.21.0
func (b *ScriptBuilder) Build() string
Build returns the complete shell script as a string.
type TestAgent ¶
type TestAgent struct {
Delay time.Duration // Simulated processing delay
Output string // Fixed output to return
Fail bool // If true, returns an error
Reasoning ReasoningLevel // Reasoning level (for testing)
}
TestAgent is a mock agent for testing that returns predictable output
func (*TestAgent) CommandLine ¶ added in v0.28.0
func (*TestAgent) WithAgentic ¶
WithAgentic returns the agent unchanged (agentic mode not applicable for test agent)
func (*TestAgent) WithModel ¶ added in v0.17.0
WithModel returns the agent unchanged (model selection not supported for test agent).
func (*TestAgent) WithReasoning ¶
func (a *TestAgent) WithReasoning(level ReasoningLevel) Agent
WithReasoning returns a copy of the agent with the specified reasoning level
type UnknownAgentError ¶ added in v0.42.0
UnknownAgentError is returned when a requested agent name is not in the registry and is not a recognized alias.
func (*UnknownAgentError) Error ¶ added in v0.42.0
func (e *UnknownAgentError) Error() string