Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(email): drop unused Gmail token fetch from UpdateThreadLabels tool (#4309)

gbirman887d74796de6
diff --git a/rust/cloud-storage/email/src/inbound/toolset/update_thread_labels.rs b/rust/cloud-storage/email/src/inbound/toolset/update_thread_labels.rs
index 13f1d90863..33688a607a 100644
--- a/rust/cloud-storage/email/src/inbound/toolset/update_thread_labels.rs
+++ b/rust/cloud-storage/email/src/inbound/toolset/update_thread_labels.rs
@@ -102,17 +102,13 @@ where
internal_error: anyhow::anyhow!("no owned link for thread"),
})?;
- let access_token = service_context.resolve_access_token(&link).await?;
-
+ // No Gmail token needed here. Label changes are written to the DB and the
+ // Gmail API calls are enqueued to the gmail_ops worker, which fetches its
+ // own token. The AI tool context has a no-op token provider, so fetching
+ // one here would always fail.
let result = service_context
.service
- .update_thread_labels(
- &access_token,
- &link,
- self.thread_id,
- self.label_id,
- self.add,
- )
+ .update_thread_labels("", &link, self.thread_id, self.label_id, self.add)
.await
.map_err(|e| ToolCallError {
description: format!("Failed to update thread labels: {e}"),