Skip to content
Closed
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
35 changes: 32 additions & 3 deletions crates/buzz-acp/src/acp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2932,11 +2932,11 @@ mod tests {
/// before `extra_env`, so the later `Command::env` write wins).
#[cfg(unix)]
#[tokio::test]
async fn spawn_applies_runtime_env_defaults_with_extra_env_precedence() {
async fn spawn_applies_hermes_env_default_with_extra_env_precedence() {
const VAR: &str = "HERMES_ACP_SKIP_CONFIGURED_MCP";
if std::env::var_os(VAR).is_some() {
// Inherited parent values win over both layers; the default and
// override behavior below is unobservable in such an environment.
// An inherited parent value wins over both layers, so the default
// and override behavior below is unobservable in this environment.
return;
}

Expand All @@ -2957,6 +2957,35 @@ mod tests {
);
}

/// Buzz must leave Claude's compaction window unset unless it was supplied
/// by the parent environment or an explicit persona entry.
#[cfg(unix)]
#[tokio::test]
async fn spawn_does_not_default_claude_compaction_window() {
const VAR: &str = "CLAUDE_CODE_AUTO_COMPACT_WINDOW";
if std::env::var_os(VAR).is_some() {
// An inherited parent value is intentionally forwarded and makes
// the unset behavior below unobservable in this environment.
return;
}

assert_eq!(
spawn_named_and_read_child_env("claude-agent-acp", VAR, &[]).await,
"<unset>",
"Claude spawns must preserve Claude's own effective configuration"
);
assert_eq!(
spawn_named_and_read_child_env(
"claude-agent-acp",
VAR,
&[(VAR.into(), "300000".into())]
)
.await,
"300000",
"an explicit persona entry must be forwarded"
);
}

#[tokio::test]
async fn idle_timeout_fires_on_silent_process() {
let mut client = spawn_script("sleep 10").await;
Expand Down
11 changes: 10 additions & 1 deletion crates/buzz-acp/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,16 @@ mod tests {
"unexpected env defaults for {command}"
);
}
for command in ["goose", "codex-acp", "claude-agent-acp", "buzz-agent", ""] {
for command in [
"goose",
"codex-acp",
"claude-agent-acp",
"claude-code-acp",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like claude-code-acp is mostly for older version of the acp so i'm going to close the PR

https://github.com/block/buzz/blob/main/crates/buzz-acp/README.md#running-with-claude-code

"claude-code",
"claudecode",
"buzz-agent",
"",
] {
assert!(
default_agent_env(command).is_empty(),
"non-Hermes command must have no env defaults: {command}"
Expand Down
Loading