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.

chore(agents): keep thread-confirmation mechanics out of user-facing agent replies (#7019)

Wolf Mermelstein2950b62a5c4b
diff --git a/crates/prompt/src/lib.rs b/crates/prompt/src/lib.rs
index ba31cb45a5..1193ff4e6d 100644
--- a/crates/prompt/src/lib.rs
+++ b/crates/prompt/src/lib.rs
@@ -216,6 +216,20 @@ mod tests {
assert!(session.contains("decided per"));
}
+ #[test]
+ fn session_tool_use_prompt_keeps_the_thread_mechanics_away_from_the_user() {
+ // The thread rule explains review cards and the session view so the
+ // model knows why it writes the draft out. None of that is for the
+ // user, who asked for an email or an event and should just get the
+ // draft and a question - not a note about where their prompt came from.
+ let session = SESSION_TOOL_USE_PROMPT.to_string();
+ assert!(session.contains("The rule above is for you, not the user"));
+ assert!(session.contains("Never explain why you are writing the draft out"));
+ assert!(session.contains("not mention the agent session view, review cards"));
+ assert!(session.contains("does not know or care"));
+ assert!(session.contains("with no preamble about"));
+ }
+
#[test]
fn chat_prompt_names_the_confirmed_send_only_to_rule_it_out() {
// The chat host has the same toolset and a composer, so the direct
diff --git a/crates/prompt/src/user_tools.rs b/crates/prompt/src/user_tools.rs
index e5978d536c..219187c453 100644
--- a/crates/prompt/src/user_tools.rs
+++ b/crates/prompt/src/user_tools.rs
@@ -58,6 +58,13 @@ static SESSION_INSTRUCTIONS: &str = r##"- Before reaching for `SendEmail` or `Cr
quoted verbatim in `userConfirmation`. Never call it without such a reply, and never paraphrase
or invent one.
+- The rule above is for you, not the user. Never explain why you are writing the draft out: do
+ not mention the agent session view, review cards, threads versus sessions, `AskUser`, tools,
+ or anything waiting unseen. The user asked for an email or an event and does not know or care
+ how the agent works. Lead with the draft the way a colleague would - "Here's the event I'd
+ create - look good?" or "Here's the email - want me to send it?" - with no preamble about
+ where the prompt came from or how confirmation works.
+
- From the agent session view, `SendEmail` and `CreateCalendarEvent` are reviewed by the user
before they run. Calling one opens a review card in the session, the turn waits while the user
edits, confirms or declines, and the tool then returns what happened: the sent email or created
@@ -74,7 +81,8 @@ static SESSION_INSTRUCTIONS: &str = r##"- Before reaching for `SendEmail` or `Cr
static SESSION_INTENT: &str = "The model checks where the newest prompt came from before using a \
user tool: from a channel or document thread it states the whole email or event verbatim in its \
-reply, asks, and sends only on the user's approving reply through SendConfirmedEmail; from the \
+reply, asks, and sends only on the user's approving reply through SendConfirmedEmail - without \
+ever explaining the session, review card or thread mechanics to the user; from the \
session view it calls SendEmail or CreateCalendarEvent and lets the review card be the \
confirmation, never asking for confirmation in prose first.";