Skip to content

Commit e777efe

Browse files
committed
fix(web): the roster shows recipients as a list, never comma-joined (CL-8585)
1 parent e333684 commit e777efe

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

agents/myra/src/system-prompt.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const ASSISTANT_SYSTEM_PROMPT =
3939
"message. Never construct an address from an agent's name or slug " +
4040
"to reach it — that address does not route.\n" +
4141
"\n" +
42-
"When you hand a task to another participant, copy the person's " +
43-
'address from that same "Participants:" block in `to` so they can ' +
44-
"follow the conversation, and give every mail you send a short subject.";
42+
"When you hand a task to another participant, pass `to` as a list " +
43+
'holding their address and the person\'s from that same "Participants:" ' +
44+
"block, never one comma-joined string, so the person can follow the " +
45+
"conversation, and give every mail you send a short subject.";

apps/web/src/chat/room-roster.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("appendRoster / stripRoster", () => {
2929
expect(withRoster).toBe(
3030
"Please pass this to the scribe.\n\n" +
3131
"Participants:\nSawyer <usr_sawyer@room.example>\nScribe <run_abc@room.example>\n\n" +
32-
"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.",
32+
'When you mail another participant, pass `to` as a list with them and the person, e.g. `to: ["<their address>", "usr_sawyer@room.example"]`, never one comma-joined string, and give every mail a short subject.',
3333
);
3434
expect(stripRoster(withRoster)).toBe(body);
3535
});
@@ -41,7 +41,7 @@ describe("appendRoster / stripRoster", () => {
4141
{ name: "Scribe", address: "run_abc@room.example", kind: "agent" },
4242
]);
4343
expect(withRoster).toContain(
44-
"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.",
44+
'`to: ["<their address>", "usr_sawyer@room.example", "usr_alex@room.example"]`',
4545
);
4646
});
4747
});

apps/web/src/chat/room-roster.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ function rosterBlock(entries: readonly RosterEntry[]): string {
3030
function ccInstruction(entries: readonly RosterEntry[]): string | undefined {
3131
const people = entries.filter((entry) => entry.kind === "person");
3232
if (people.length === 0) return undefined;
33-
const addresses = people.map((entry) => entry.address).join(", ");
34-
// The subject clause is load-bearing: a mail with an empty Subject ends
35-
// the receiving agent's run today.
36-
return `Copy ${addresses} in \`to\` on any mail you send another participant, so they can follow along, and give every mail a short subject.`;
33+
const quoted = people.map((entry) => `"${entry.address}"`).join(", ");
34+
// The list shape and the subject clause are both load-bearing: a
35+
// comma-joined `to` string is dropped as one bad recipient, and a mail
36+
// with an empty Subject ends the receiving agent's run today.
37+
return `When you mail another participant, pass \`to\` as a list with them and the person, e.g. \`to: ["<their address>", ${quoted}]\`, never one comma-joined string, and give every mail a short subject.`;
3738
}
3839

3940
/** Appends a `Participants:` block listing every entry's name and address,

0 commit comments

Comments
 (0)