chore: cargo fmt --all — clean up a2a merge's fmt violations
ci / gates (push) Successful in 7s
ci / rust (push) Failing after 49s
ci / frontend (push) Successful in 52s
ci / e2e (push) Has been skipped
ci / publish (push) Successful in 3m6s

The a2a merge (d0d8e7f) landed with a handful of pre-existing rustfmt
diffs that were failing `cargo fmt --all --check` in CI. Pure whitespace
reformatting from `cargo fmt --all`; no semantic changes. Files touched:
mcp_door.rs, quota.rs, routes/a2a.rs, routes/world.rs, runtime_provision.rs,
chat_repos.rs test, and tools/chat.rs.
This commit is contained in:
Omar Sobh
2026-07-05 18:54:15 -07:00
parent 812bc29db6
commit ebb5b5780b
7 changed files with 103 additions and 39 deletions
+26 -5
View File
@@ -244,7 +244,10 @@ async fn caller_agent(
user: &cm_auth::AuthedUser,
headers: &HeaderMap,
) -> Result<cm_domain::AgentId, String> {
if let Some(alias) = headers.get("x-zeroclaw-agent").and_then(|v| v.to_str().ok()) {
if let Some(alias) = headers
.get("x-zeroclaw-agent")
.and_then(|v| v.to_str().ok())
{
if let Some(hex) = alias.strip_prefix("claw_") {
if let Ok(uuid) = uuid::Uuid::parse_str(hex) {
let agent_id = cm_domain::AgentId::from(uuid);
@@ -277,10 +280,18 @@ async fn delegate_call(
args: &Value,
id: Option<Value>,
) -> Json<Value> {
let Some(to) = args.get("to").and_then(|v| v.as_str()).filter(|s| !s.is_empty()) else {
let Some(to) = args
.get("to")
.and_then(|v| v.as_str())
.filter(|s| !s.is_empty())
else {
return tool_result(id, true, "delegate: missing 'to' (target claw name)".into());
};
let Some(task) = args.get("task").and_then(|v| v.as_str()).filter(|s| !s.is_empty()) else {
let Some(task) = args
.get("task")
.and_then(|v| v.as_str())
.filter(|s| !s.is_empty())
else {
return tool_result(id, true, "delegate: missing 'task'".into());
};
let context: Vec<String> = args
@@ -296,10 +307,20 @@ async fn delegate_call(
// Resolve the target claw by name within the workspace.
let target = match cm_db::repo::agents::roster(&state.pool, user.workspace_id).await {
Ok(roster) => roster.into_iter().find(|a| a.name.eq_ignore_ascii_case(to)),
Err(_) => return tool_result(id, true, "delegate: failed to resolve workspace roster".into()),
Err(_) => {
return tool_result(
id,
true,
"delegate: failed to resolve workspace roster".into(),
)
}
};
let Some(target) = target else {
return tool_result(id, true, format!("delegate: no claw named {to:?} in this workspace"));
return tool_result(
id,
true,
format!("delegate: no claw named {to:?} in this workspace"),
);
};
if target.id == caller {
return tool_result(id, true, "delegate: cannot delegate to yourself".into());