Skip to content
Open
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
60 changes: 30 additions & 30 deletions crates/buzz-acp/src/acp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ impl AcpClient {
// on ACP v2 ahead of the upstream ACP RFD. Revisit when that RFD merges.
let params = build_initialize_params();
let result = self.send_request("initialize", params).await?;
tracing::debug!(target: "acp::init", "initialize response: {result}");
tracing::debug!(target: "buzz_acp::acp::init", "initialize response: {result}");
Ok(result)
}

Expand Down Expand Up @@ -585,7 +585,7 @@ impl AcpClient {
.as_str()
.ok_or_else(|| AcpError::Protocol("session/new response missing sessionId".into()))?
.to_owned();
tracing::info!(target: "acp::session", "session created: {session_id}");
tracing::info!(target: "buzz_acp::acp::session", "session created: {session_id}");
Ok(SessionNewResponse {
session_id,
raw: result,
Expand Down Expand Up @@ -708,7 +708,7 @@ impl AcpClient {
"params": params,
});

tracing::debug!(target: "acp::wire", "→ {}", &serde_json::to_string(&msg).unwrap_or_default());
tracing::debug!(target: "buzz_acp::acp::wire", "→ {}", &serde_json::to_string(&msg).unwrap_or_default());
if let Err(e) = self.write_ndjson(&msg).await {
self.last_prompt_id = None;
self.current_hard_deadline = None;
Expand Down Expand Up @@ -921,7 +921,7 @@ impl AcpClient {
let response = permission_response_cancelled(&perm_id);
self.write_ndjson(&response).await?;
tracing::debug!(
target: "acp::cancel",
target: "buzz_acp::acp::cancel",
"responded cancelled to pending permission id={perm_id}"
);
}
Expand All @@ -931,7 +931,7 @@ impl AcpClient {

// Step 2: send session/cancel notification (no id)
self.session_cancel(session_id).await?;
tracing::info!(target: "acp::cancel", "sent session/cancel for {session_id}");
tracing::info!(target: "buzz_acp::acp::cancel", "sent session/cancel for {session_id}");
// Use a fixed 30s idle timeout during cleanup — the cancel notification
// needs time to propagate and the agent may go silent while winding down.
// The separate hard_deadline bounds agents that keep producing output
Expand Down Expand Up @@ -999,7 +999,7 @@ impl AcpClient {
"params": params,
});

tracing::debug!(target: "acp::wire", "→ {}", &serde_json::to_string(&msg).unwrap_or_default());
tracing::debug!(target: "buzz_acp::acp::wire", "→ {}", &serde_json::to_string(&msg).unwrap_or_default());

// Wrap write + read in a single timeout so a hung agent can't block forever.
// We cannot use an async block that borrows `self` mutably across two awaits
Expand Down Expand Up @@ -1041,7 +1041,7 @@ impl AcpClient {
Err(_) | Ok(None) => break,
Ok(Some(Ok(_))) => {
// Consumed one buffered line; loop to drain more.
tracing::debug!(target: "acp::wire", "drained stale buffered line");
tracing::debug!(target: "buzz_acp::acp::wire", "drained stale buffered line");
}
Ok(Some(Err(_))) => break,
}
Expand All @@ -1064,7 +1064,7 @@ impl AcpClient {
"params": params,
});

tracing::debug!(target: "acp::wire", "→ (notification) {}", &serde_json::to_string(&msg).unwrap_or_default());
tracing::debug!(target: "buzz_acp::acp::wire", "→ (notification) {}", &serde_json::to_string(&msg).unwrap_or_default());
self.write_ndjson(&msg).await?;
Ok(())
}
Expand Down Expand Up @@ -1106,7 +1106,7 @@ impl AcpClient {
}

// Only log and reset idle after we have a valid non-empty line.
tracing::debug!(target: "acp::wire", "← {trimmed}");
tracing::debug!(target: "buzz_acp::acp::wire", "← {trimmed}");

let msg: serde_json::Value = match serde_json::from_str(trimmed) {
Ok(v) => v,
Expand All @@ -1119,7 +1119,7 @@ impl AcpClient {
}),
);
tracing::warn!(
target: "acp::wire",
target: "buzz_acp::acp::wire",
"failed to parse line as JSON: {e} — skipping"
);
continue;
Expand Down Expand Up @@ -1165,7 +1165,7 @@ impl AcpClient {
// agent process is dead and continuing would hang.
self.write_ndjson(&err_resp).await?;
}
tracing::debug!(target: "acp::wire", "ignoring unknown method: {other}");
tracing::debug!(target: "buzz_acp::acp::wire", "ignoring unknown method: {other}");
}
}
}
Expand Down Expand Up @@ -1322,7 +1322,7 @@ impl AcpClient {
"params": params,
});
tracing::debug!(
target: "acp::wire",
target: "buzz_acp::acp::wire",
"→ {}",
serde_json::to_string(&msg).unwrap_or_default()
);
Expand Down Expand Up @@ -1400,7 +1400,7 @@ impl AcpClient {
continue;
}

tracing::debug!(target: "acp::wire", "← {trimmed}");
tracing::debug!(target: "buzz_acp::acp::wire", "← {trimmed}");

let msg: serde_json::Value = match serde_json::from_str(trimmed) {
Ok(v) => v,
Expand All @@ -1413,7 +1413,7 @@ impl AcpClient {
}),
);
tracing::warn!(
target: "acp::wire",
target: "buzz_acp::acp::wire",
"failed to parse line as JSON: {e} — skipping"
);
continue;
Expand Down Expand Up @@ -1512,7 +1512,7 @@ impl AcpClient {
// agent process is dead and continuing would hang.
self.write_ndjson(&err_resp).await?;
}
tracing::debug!(target: "acp::wire", "ignoring unknown method: {other}");
tracing::debug!(target: "buzz_acp::acp::wire", "ignoring unknown method: {other}");
}
}
}
Expand Down Expand Up @@ -1542,7 +1542,7 @@ impl AcpClient {
match update_type {
"agent_message_chunk" => {
if let Some(text) = update["content"]["text"].as_str() {
tracing::info!(target: "acp::stream", "{text}");
tracing::info!(target: "buzz_acp::acp::stream", "{text}");
}
false
}
Expand All @@ -1555,7 +1555,7 @@ impl AcpClient {
.get("kind")
.and_then(|v| v.as_str())
.unwrap_or("unknown");
tracing::info!(target: "acp::tool", "tool_call: {title} ({kind})");
tracing::info!(target: "buzz_acp::acp::tool", "tool_call: {title} ({kind})");
true
}
"tool_call_update" => {
Expand All @@ -1564,16 +1564,16 @@ impl AcpClient {
.and_then(|v| v.as_str())
.unwrap_or("?");
let status = update.get("status").and_then(|v| v.as_str()).unwrap_or("?");
tracing::info!(target: "acp::tool", "tool_call_update: {tool_id} → {status}");
tracing::info!(target: "buzz_acp::acp::tool", "tool_call_update: {tool_id} → {status}");
false
}
"plan" => {
tracing::info!(target: "acp::plan", "plan update received");
tracing::info!(target: "buzz_acp::acp::plan", "plan update received");
false
}
"agent_thought_chunk" => {
if let Some(text) = update["content"]["text"].as_str() {
tracing::debug!(target: "acp::thought", "{text}");
tracing::debug!(target: "buzz_acp::acp::thought", "{text}");
}
false
}
Expand All @@ -1585,7 +1585,7 @@ impl AcpClient {
.map(|cmds| cmds.iter().filter_map(|c| c["name"].as_str()).collect())
.unwrap_or_default();
tracing::info!(
target: "acp::update",
target: "buzz_acp::acp::update",
"available_commands_update: {} commands [{}]",
names.len(),
names.join(", ")
Expand All @@ -1610,14 +1610,14 @@ impl AcpClient {
match goose_meta.get("activeRunId") {
Some(serde_json::Value::String(run_id)) => {
tracing::debug!(
target: "acp::update",
target: "buzz_acp::acp::update",
"session_info_update: activeRunId={run_id}"
);
self.active_run_id = Some(run_id.clone());
}
Some(serde_json::Value::Null) => {
tracing::debug!(
target: "acp::update",
target: "buzz_acp::acp::update",
"session_info_update: activeRunId cleared"
);
self.active_run_id = None;
Expand All @@ -1630,7 +1630,7 @@ impl AcpClient {
}
"keepalive" => false,
other => {
tracing::debug!(target: "acp::update", "session/update: {other}");
tracing::debug!(target: "buzz_acp::acp::update", "session/update: {other}");
false
}
}
Expand All @@ -1648,7 +1648,7 @@ impl AcpClient {
Some(p) => p,
None => {
tracing::debug!(
target: "acp::usage",
target: "buzz_acp::acp::usage",
"_goose/unstable/session/update: missing params"
);
return;
Expand All @@ -1658,7 +1658,7 @@ impl AcpClient {
Ok(notif) => {
if let GooseSessionUpdateVariant::UsageUpdate(payload) = &notif.update {
tracing::debug!(
target: "acp::usage",
target: "buzz_acp::acp::usage",
session_id = %notif.session_id,
input = payload.accumulated_input_tokens,
output = payload.accumulated_output_tokens,
Expand All @@ -1669,7 +1669,7 @@ impl AcpClient {
}
Err(e) => {
tracing::debug!(
target: "acp::usage",
target: "buzz_acp::acp::usage",
"_goose/unstable/session/update: deserialization error: {e}"
);
}
Expand Down Expand Up @@ -1702,7 +1702,7 @@ impl AcpClient {
.ok_or_else(|| AcpError::Protocol("permission request missing options".into()))?;

tracing::debug!(
target: "acp::permission",
target: "buzz_acp::acp::permission",
"session/request_permission id={id}, {} options",
options.len()
);
Expand All @@ -1717,14 +1717,14 @@ impl AcpClient {
.as_str()
.ok_or_else(|| AcpError::Protocol("allow_once option missing optionId".into()))?;
tracing::info!(
target: "acp::permission",
target: "buzz_acp::acp::permission",
"auto-approving permission id={id} with allow_once optionId={option_id:?}"
);
permission_response_selected(&id, option_id)
} else {
// No allow_once — fall back to reject_once.
tracing::warn!(
target: "acp::permission",
target: "buzz_acp::acp::permission",
"no allow_once option found in permission request id={id}, falling back to reject_once"
);
let reject = options
Expand Down
2 changes: 1 addition & 1 deletion crates/buzz-acp/src/engram_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub async fn build_core_section(
Ok(None) => Some(format!("[{SECTION_LABEL}]\n{ONBOARDING_NUDGE}")),
Err(reason) => {
tracing::warn!(
target: "engram::core",
target: "buzz_acp::engram::core",
"core fetch failed: {reason} — emitting no section to avoid \
confusing a relay outage with an absent core"
);
Expand Down
2 changes: 1 addition & 1 deletion crates/buzz-acp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ async fn tokio_main() -> Result<()> {

if !config.memory_enabled {
tracing::info!(
target: "engram::core",
target: "buzz_acp::engram::core",
"NIP-AE core memory injection disabled (re-enable by removing --no-memory / BUZZ_ACP_NO_MEMORY)"
);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/buzz-acp/src/observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl ObserverHandle {
match self.inner.buffer.lock() {
Ok(buffer) => buffer.iter().cloned().collect(),
Err(error) => {
tracing::warn!(target: "observer", "observer replay buffer lock poisoned: {error}");
tracing::warn!(target: "buzz_acp::observer", "observer replay buffer lock poisoned: {error}");
Vec::new()
}
}
Expand Down Expand Up @@ -128,7 +128,7 @@ impl ObserverHandle {
buffer.push_back(event.clone());
}
Err(error) => {
tracing::warn!(target: "observer", "observer replay buffer lock poisoned: {error}");
tracing::warn!(target: "buzz_acp::observer", "observer replay buffer lock poisoned: {error}");
}
}

Expand Down
Loading