style: fix cargo fmt formatting

https://claude.ai/code/session_01Ci7CAdGaHhssYdio7wxVvd
This commit is contained in:
Claude
2026-03-28 16:01:35 +00:00
parent 4fb0d53206
commit 3930184e71
5 changed files with 22 additions and 13 deletions
+1 -3
View File
@@ -1163,9 +1163,7 @@ impl Agent {
"Blocked approval for thread with no pending approval"
);
drop(sess);
return Ok(Some(
"Error: no pending approval on this thread".into(),
));
return Ok(Some("Error: no pending approval on this thread".into()));
}
let authorized = crate::agent::session::is_approval_authorized(
+1 -3
View File
@@ -252,9 +252,7 @@ pub fn is_approval_authorized(source: Option<&str>, requesting: &str) -> bool {
match source {
None => false,
Some(src) if src == BOOTSTRAP_SOURCE_CHANNEL => true,
Some(src) => {
src == requesting || requesting == "web" || requesting == "gateway"
}
Some(src) => src == requesting || requesting == "web" || requesting == "gateway",
}
}
+6 -5
View File
@@ -146,17 +146,18 @@ impl Agent {
} else {
None
};
let effective_source_channel = db_source_channel
.as_deref()
.or(Some(&*message.channel));
let effective_source_channel = db_source_channel.as_deref().or(Some(&*message.channel));
let session_id = {
let sess = session.lock().await;
sess.id
};
let mut thread =
crate::agent::session::Thread::with_id(thread_uuid, session_id, effective_source_channel);
let mut thread = crate::agent::session::Thread::with_id(
thread_uuid,
session_id,
effective_source_channel,
);
if !chat_messages.is_empty() {
thread.restore_from_messages(chat_messages);
}
+7 -1
View File
@@ -593,7 +593,13 @@ pub async fn chat_new_thread_handler(
// so that the subsequent loadThreads() call from the frontend sees it.
if let Some(ref store) = state.store {
match store
.ensure_conversation(thread_id, "gateway", &identity.user_id, None, Some("gateway"))
.ensure_conversation(
thread_id,
"gateway",
&identity.user_id,
None,
Some("gateway"),
)
.await
{
Ok(true) => {}
+7 -1
View File
@@ -48,7 +48,13 @@ mod tests {
let store = rig.database();
assert!(
store
.ensure_conversation(foreign_thread_id, "gateway", "victim-user", None, Some("gateway"))
.ensure_conversation(
foreign_thread_id,
"gateway",
"victim-user",
None,
Some("gateway")
)
.await
.expect("failed to create victim conversation"),
"test setup failed: victim conversation was not created"