Improve AI provider model configuration
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
use galaxy_acp::{AcpAgentPreset, AcpLaunchConfig, CODEX_ACP_NPM_VERSION, OPENCODE_NPM_VERSION};
|
||||
use galaxy_acp::{
|
||||
resolve_known_acp_agent, AcpAgentPreset, AcpLaunchConfig, CODEX_ACP_NPM_VERSION,
|
||||
OPENCODE_NPM_VERSION,
|
||||
};
|
||||
use sha2::{Digest as _, Sha256};
|
||||
|
||||
use crate::persistence::model::AcpConversationData;
|
||||
@@ -215,9 +218,11 @@ pub(crate) fn resolve_acp_launch(
|
||||
match agent_id.trim().to_ascii_lowercase().as_str() {
|
||||
"codex" => AcpAgentPreset::Codex.resolve_launch_config(),
|
||||
"opencode" => AcpAgentPreset::OpenCode.resolve_launch_config(),
|
||||
unknown => Err(format!(
|
||||
"Unknown ACP agent preset {unknown:?}; choose \"codex\" or \"opencode\", or configure a custom ACP executable"
|
||||
)),
|
||||
_ => resolve_known_acp_agent(agent_id).map_err(|error| {
|
||||
format!(
|
||||
"{error} Configure a custom ACP executable if this client uses a different command."
|
||||
)
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use super::*;
|
||||
fn unknown_builtin_agent_ids_are_rejected() {
|
||||
let error = resolve_acp_launch("mystery-agent", "", &[]).unwrap_err();
|
||||
|
||||
assert!(error.contains("Unknown ACP agent preset"));
|
||||
assert!(error.contains("Unknown ACP agent"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user