Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.1.111"
version = "0.1.112"
edition = "2024"
rust-version = "1.85"
license = "Apache-2.0"
Expand Down
5 changes: 5 additions & 0 deletions crates/cli-sub-agent/src/run_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ pub(crate) fn parse_tool_name(name: &str) -> Result<ToolName> {
"opencode" => Ok(ToolName::Opencode),
"codex" => Ok(ToolName::Codex),
"claude-code" => Ok(ToolName::ClaudeCode),
"openai-compat" => Ok(ToolName::OpenaiCompat),
_ => anyhow::bail!("Unknown tool: {}", name),
}
}
Expand Down Expand Up @@ -418,6 +419,10 @@ pub(crate) fn resolve_tool_from_tier(
/// binary (`codex-acp`, `claude-code-acp`). For legacy tools, checks the
/// native CLI binary.
pub(crate) fn is_tool_binary_available(tool_name: &str) -> bool {
// OpenAI-compat is HTTP-only — no binary to check.
if tool_name == "openai-compat" {
return true;
}
let binary = match tool_name {
"gemini-cli" => "gemini",
"opencode" => "opencode",
Expand Down
8 changes: 8 additions & 0 deletions crates/csa-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ pub struct ToolConfig {
/// Defaults to false for explicit safety.
#[serde(default)]
pub codex_auto_trust: bool,
/// OpenAI-compat only: base URL for the API endpoint (e.g., "http://localhost:8317").
#[serde(default, skip_serializing_if = "Option::is_none")]
pub base_url: Option<String>,
/// API key for authentication. Used by openai-compat and gemini-cli (fallback).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub api_key: Option<String>,
}

impl Default for ToolConfig {
Expand All @@ -390,6 +396,8 @@ impl Default for ToolConfig {
default_thinking: None,
thinking_lock: None,
codex_auto_trust: false,
base_url: None,
api_key: None,
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/csa-config/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ pub fn all_known_tools() -> &'static [ToolName] {
ToolName::Opencode,
ToolName::Codex,
ToolName::ClaudeCode,
ToolName::OpenaiCompat,
]
}

Expand Down
3 changes: 2 additions & 1 deletion crates/csa-config/src/global_tests_heterogeneous.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ max_concurrent = 3
#[test]
fn test_all_known_tools() {
let tools = all_known_tools();
assert_eq!(tools.len(), 4);
assert_eq!(tools.len(), 5);
assert!(tools.contains(&ToolName::GeminiCli));
assert!(tools.contains(&ToolName::Opencode));
assert!(tools.contains(&ToolName::Codex));
assert!(tools.contains(&ToolName::ClaudeCode));
assert!(tools.contains(&ToolName::OpenaiCompat));
}

#[test]
Expand Down
16 changes: 14 additions & 2 deletions crates/csa-config/src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ fn validate_acp(config: &ProjectConfig) -> Result<()> {
}

fn validate_tools(config: &ProjectConfig) -> Result<()> {
let known_tools = ["gemini-cli", "opencode", "codex", "claude-code"];
let known_tools = [
"gemini-cli",
"opencode",
"codex",
"claude-code",
"openai-compat",
];
for (tool_name, tool_config) in &config.tools {
if !known_tools.contains(&tool_name.as_str()) {
bail!(
Expand Down Expand Up @@ -267,7 +273,13 @@ fn validate_tiers(config: &ProjectConfig) -> Result<()> {
/// Warn (non-fatal) if `preferences.tool_priority` contains unrecognized tool names.
/// Unknown entries are harmless (sorted to end) but likely indicate a typo.
fn warn_unknown_tool_priority(config: &ProjectConfig) {
let known_tools = ["gemini-cli", "opencode", "codex", "claude-code"];
let known_tools = [
"gemini-cli",
"opencode",
"codex",
"claude-code",
"openai-compat",
];
if let Some(prefs) = &config.preferences {
for name in &prefs.tool_priority {
if !known_tools.contains(&name.as_str()) {
Expand Down
9 changes: 8 additions & 1 deletion crates/csa-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub enum ToolName {
Opencode,
Codex,
ClaudeCode,
OpenaiCompat,
}

impl ToolName {
Expand All @@ -20,6 +21,7 @@ impl ToolName {
Self::Opencode => "opencode",
Self::Codex => "codex",
Self::ClaudeCode => "claude-code",
Self::OpenaiCompat => "openai-compat",
}
}

Expand All @@ -30,6 +32,7 @@ impl ToolName {
Self::GeminiCli => ModelFamily::Gemini,
Self::Codex => ModelFamily::OpenAI,
Self::Opencode => ModelFamily::Other,
Self::OpenaiCompat => ModelFamily::Other,
}
}

Expand Down Expand Up @@ -57,6 +60,9 @@ pub fn prompt_transport_capabilities(tool: &ToolName) -> &'static [PromptTranspo
ToolName::GeminiCli => PROMPT_TRANSPORT_ARGV_AND_STDIN,
ToolName::ClaudeCode => PROMPT_TRANSPORT_ARGV_AND_STDIN,
ToolName::Opencode => PROMPT_TRANSPORT_ARGV_ONLY,
// OpenAI-compat is HTTP-only; prompt transport is irrelevant (no CLI process).
// Return Stdin to satisfy callers that check capabilities.
ToolName::OpenaiCompat => PROMPT_TRANSPORT_ARGV_AND_STDIN,
}
}

Expand Down Expand Up @@ -111,6 +117,7 @@ impl std::str::FromStr for ToolArg {
"opencode" => Ok(Self::Specific(ToolName::Opencode)),
"codex" => Ok(Self::Specific(ToolName::Codex)),
"claude-code" => Ok(Self::Specific(ToolName::ClaudeCode)),
"openai-compat" => Ok(Self::Specific(ToolName::OpenaiCompat)),
// Built-in aliases for common short names
"gemini" => Ok(Self::Specific(ToolName::GeminiCli)),
"claude" => Ok(Self::Specific(ToolName::ClaudeCode)),
Expand Down Expand Up @@ -144,7 +151,7 @@ impl ToolArg {
} else {
Err(format!(
"unknown tool '{}'. Valid values: auto, any-available, \
gemini-cli, opencode, codex, claude-code. \
gemini-cli, opencode, codex, claude-code, openai-compat. \
Or define it in [tool_aliases] in config.",
alias
))
Expand Down
1 change: 1 addition & 0 deletions crates/csa-executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ tracing.workspace = true
tracing-appender.workspace = true
chrono.workspace = true
regex.workspace = true
reqwest.workspace = true

[features]
codex-pty-fork = ["csa-process/codex-pty-fork"]
Expand Down
10 changes: 9 additions & 1 deletion crates/csa-executor/src/agent_backend_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ impl ExecutorAgentBackend {
match executor {
Executor::ClaudeCode { .. } => BackendType::ClaudeCode,
Executor::GeminiCli { .. } => BackendType::GeminiCli,
Executor::Codex { .. } | Executor::Opencode { .. } => BackendType::Codex,
Executor::Codex { .. } | Executor::Opencode { .. } | Executor::OpenaiCompat { .. } => {
BackendType::Codex
}
}
}

Expand All @@ -71,6 +73,9 @@ impl ExecutorAgentBackend {
} => *m = Some(model_override.clone()),
Executor::ClaudeCode {
model_override: m, ..
} => *m = Some(model_override.clone()),
Executor::OpenaiCompat {
model_override: m, ..
} => *m = Some(model_override),
}
}
Expand All @@ -94,6 +99,9 @@ impl ExecutorAgentBackend {
} => *thinking_budget = Some(budget.clone()),
Executor::ClaudeCode {
thinking_budget, ..
} => *thinking_budget = Some(budget.clone()),
Executor::OpenaiCompat {
thinking_budget, ..
} => *thinking_budget = Some(budget),
}
}
Expand Down
Loading
Loading