diff --git a/agents/myra/src/system-prompt.ts b/agents/myra/src/system-prompt.ts index 43b5296f4..bcb908650 100644 --- a/agents/myra/src/system-prompt.ts +++ b/agents/myra/src/system-prompt.ts @@ -39,6 +39,7 @@ export const ASSISTANT_SYSTEM_PROMPT = "message. Never construct an address from an agent's name or slug " + "to reach it — that address does not route.\n" + "\n" + - "When you hand a task to another participant, copy the person's " + - 'address from that same "Participants:" block in `to` so they can ' + - "follow the conversation, and give every mail you send a short subject."; + "When you hand a task to another participant, pass `to` as a list " + + 'holding their address and the person\'s from that same "Participants:" ' + + "block, never one comma-joined string, so the person can follow the " + + "conversation, and give every mail you send a short subject."; diff --git a/apps/web/src/chat/room-roster.test.ts b/apps/web/src/chat/room-roster.test.ts index f58b2f0c4..9f2f8de69 100644 --- a/apps/web/src/chat/room-roster.test.ts +++ b/apps/web/src/chat/room-roster.test.ts @@ -23,25 +23,25 @@ describe("appendRoster / stripRoster", () => { test("appends a cc instruction naming the person, and strips it too", () => { const body = "Please pass this to the scribe."; const withRoster = appendRoster(body, [ - { name: "Sawyer", address: "usr_sawyer@room.example", kind: "person" }, - { name: "Scribe", address: "run_abc@room.example", kind: "agent" }, + { name: "Alice", address: "alice@example.com", kind: "person" }, + { name: "Scribe", address: "run_abc@example.com", kind: "agent" }, ]); expect(withRoster).toBe( "Please pass this to the scribe.\n\n" + - "Participants:\nSawyer \nScribe \n\n" + - "Copy usr_sawyer@room.example in `to` on any mail you send another participant, so they can follow along, and give every mail a short subject.", + "Participants:\nAlice \nScribe \n\n" + + 'When you mail another participant, pass `to` as a list with them and the person, e.g. `to: ["", "alice@example.com"]`, never one comma-joined string, and give every mail a short subject.', ); expect(stripRoster(withRoster)).toBe(body); }); test("names every person when more than one is in the roster", () => { const withRoster = appendRoster("hi", [ - { name: "Sawyer", address: "usr_sawyer@room.example", kind: "person" }, - { name: "Alex", address: "usr_alex@room.example", kind: "person" }, - { name: "Scribe", address: "run_abc@room.example", kind: "agent" }, + { name: "Alice", address: "alice@example.com", kind: "person" }, + { name: "Bob", address: "bob@example.com", kind: "person" }, + { name: "Scribe", address: "run_abc@example.com", kind: "agent" }, ]); expect(withRoster).toContain( - "Copy usr_sawyer@room.example, usr_alex@room.example in `to` on any mail you send another participant, so they can follow along, and give every mail a short subject.", + '`to: ["", "alice@example.com", "bob@example.com"]`', ); }); }); diff --git a/apps/web/src/chat/room-roster.ts b/apps/web/src/chat/room-roster.ts index fbd0c7081..4f7cb8aa9 100644 --- a/apps/web/src/chat/room-roster.ts +++ b/apps/web/src/chat/room-roster.ts @@ -30,10 +30,11 @@ function rosterBlock(entries: readonly RosterEntry[]): string { function ccInstruction(entries: readonly RosterEntry[]): string | undefined { const people = entries.filter((entry) => entry.kind === "person"); if (people.length === 0) return undefined; - const addresses = people.map((entry) => entry.address).join(", "); - // The subject clause is load-bearing: a mail with an empty Subject ends - // the receiving agent's run today. - return `Copy ${addresses} in \`to\` on any mail you send another participant, so they can follow along, and give every mail a short subject.`; + const quoted = people.map((entry) => `"${entry.address}"`).join(", "); + // The list shape and the subject clause are both load-bearing: a + // comma-joined `to` string is dropped as one bad recipient, and a mail + // with an empty Subject ends the receiving agent's run today. + return `When you mail another participant, pass \`to\` as a list with them and the person, e.g. \`to: ["", ${quoted}]\`, never one comma-joined string, and give every mail a short subject.`; } /** Appends a `Participants:` block listing every entry's name and address,