Skip to content

Commit d6bd23d

Browse files
theahuranori-agent
andcommitted
fix(acp): set CLAUDE_CODE_EXECUTABLE to fix musl binary resolution
The v0.30.0 adapter resolves its native binary via require.resolve() on platform-specific optional deps. On Linux it tries the musl variant first; if that file exists but the musl loader is missing, the binary silently fails to execute, causing "Failed to create ACP session". Setting CLAUDE_CODE_EXECUTABLE to the system-installed claude binary sidesteps this entirely. Also adds @latest suffix to the package name to force bunx to resolve the correct scope instead of a stale @zed-industries cache entry. 🤖 Generated with [Nori](https://noriagentic.com) Co-Authored-By: Nori <contact@tilework.tech>
1 parent fe848d0 commit d6bd23d

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

nori-rs/acp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ diffy = { workspace = true }
3838
chrono = { workspace = true }
3939
uuid = { workspace = true, features = ["v4"] }
4040
sha2 = { workspace = true }
41+
which = { workspace = true }
4142

4243
[target.'cfg(unix)'.dependencies]
4344
libc = { workspace = true }

nori-rs/acp/src/registry.rs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ impl AgentKind {
9797
/// Get the ACP adapter package name for launching this agent
9898
pub fn acp_package(&self) -> &'static str {
9999
match self {
100-
AgentKind::ClaudeCode => "@agentclientprotocol/claude-agent-acp",
100+
// @latest forces bunx to resolve the new scope instead of a stale
101+
// @zed-industries cache entry with the same unscoped package name.
102+
AgentKind::ClaudeCode => "@agentclientprotocol/claude-agent-acp@latest",
101103
// Codex uses Zed's ACP adapter
102104
AgentKind::Codex => "@zed-industries/codex-acp",
103105
// Gemini has native ACP support
@@ -718,12 +720,27 @@ pub fn get_agent_config(agent_name: &str) -> Result<AcpAgentConfig> {
718720
),
719721
};
720722

723+
// The Claude ACP adapter resolves its native binary via
724+
// require.resolve() on platform-specific optional deps. On Linux it
725+
// tries the musl variant first; if that file exists but the musl
726+
// loader is missing the binary silently fails to execute. Setting
727+
// CLAUDE_CODE_EXECUTABLE to the system-installed binary sidesteps
728+
// this entirely.
729+
let mut env = HashMap::new();
730+
if agent == AgentKind::ClaudeCode
731+
&& let Ok(path) = which::which("claude") {
732+
env.insert(
733+
"CLAUDE_CODE_EXECUTABLE".to_string(),
734+
path.to_string_lossy().to_string(),
735+
);
736+
}
737+
721738
return Ok(AcpAgentConfig {
722739
agent,
723740
provider_slug: agent.slug().to_string(),
724741
command,
725742
args,
726-
env: HashMap::new(),
743+
env,
727744
provider_info: AcpProviderInfo {
728745
name: format!("{} ACP", agent.display_name()),
729746
..Default::default()
@@ -1002,7 +1019,7 @@ mod tests {
10021019
assert!(
10031020
config
10041021
.args
1005-
.contains(&"@agentclientprotocol/claude-agent-acp".to_string())
1022+
.contains(&"@agentclientprotocol/claude-agent-acp@latest".to_string())
10061023
);
10071024
assert_eq!(config.provider_info.name, "Claude Code ACP");
10081025
}

0 commit comments

Comments
 (0)