Polish multi-agent response activity

Keep active agent state aligned with replies while making the activity pill clearer with avatars and profile-aware mention resolution.

Made-with: Cursor
This commit is contained in:
Thomas Petersen
2026-04-30 10:53:44 -04:00
parent d1c44aa3bd
commit a7953ff80a
7 changed files with 95 additions and 21 deletions

View File

@@ -502,6 +502,11 @@ pub fn spawn_agent_child(
command.env("SPROUT_ACP_AGENTS", record.parallelism.to_string());
command.env("SPROUT_ACP_MULTIPLE_EVENT_HANDLING", "owner-interrupt");
command.env("SPROUT_ACP_DEDUP", "queue");
// Desktop-managed channel agents should answer explicit @mentions from any
// channel member, not just the human who created the local process. The ACP
// harness still requires mention matching by default, so this does not make
// agents react to ordinary channel chatter.
command.env("SPROUT_ACP_RESPOND_TO", "anyone");
command.env(
"GOOSE_MODE",
std::env::var("GOOSE_MODE").unwrap_or_else(|_| "auto".to_string()),

View File

@@ -327,10 +327,38 @@ where
return Err(relay_error_message(response).await);
}
response
.json::<T>()
let status = response.status();
let url = response.url().clone();
let content_type = response
.headers()
.get(reqwest::header::CONTENT_TYPE)
.and_then(|value| value.to_str().ok())
.unwrap_or("unknown")
.to_string();
let body = response
.bytes()
.await
.map_err(|error| format!("parse failed: {error}"))
.map_err(|error| format!("read response body failed: {error}"))?;
serde_json::from_slice::<T>(&body).map_err(|error| {
let snippet = String::from_utf8_lossy(&body)
.chars()
.take(240)
.collect::<String>()
.replace(['\n', '\r', '\t'], " ")
.trim()
.to_string();
if content_type.contains("text/html") && snippet.contains("Cloudflare Access") {
return format!(
"relay returned Cloudflare Access sign-in instead of JSON for {url}. Check the active workspace token or Cloudflare/WARP access."
);
}
format!(
"parse failed: {error}; relay returned {status} {content_type} for {url}: {snippet}"
)
})
}
pub async fn send_empty_request(request: reqwest::RequestBuilder) -> Result<(), String> {