Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/src/server/mcp-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ export function createMcpHandlers(deps: CreateMcpHandlersDeps) {
message: input.message,
replyTarget: agentId,
});
const prompt = `--- DISPATCH MESSAGE ---\n${envelope}\n--- END MESSAGE ---\nReply with dispatch_send_message using the replyTarget above.`;
const prompt = `--- DISPATCH MESSAGE ---\n${envelope}\n--- END MESSAGE ---\nOptional reply channel: If a response is necessary, use dispatch_send_message with the replyTarget above. Do not acknowledge routine status updates or completion messages unless a reply is explicitly requested.`;

// Deliver first: a persistence failure must never block delivery.
let delivered = false;
Expand Down
14 changes: 13 additions & 1 deletion apps/server/test/mcp-handlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,19 @@ describe("createMcpHandlers", () => {
expect(result.targetAgentId).toBe("agt_target1");
expect(deps.sendAgentPrompt).toHaveBeenCalledWith(
"agt_target1",
expect.stringContaining("DISPATCH MESSAGE"),
`--- DISPATCH MESSAGE ---\n${JSON.stringify({
from: "test-agent",
senderId: "agt_test1",
message: "hello",
replyTarget: "agt_test1",
})}\n--- END MESSAGE ---\nOptional reply channel: If a response is necessary, use dispatch_send_message with the replyTarget above. Do not acknowledge routine status updates or completion messages unless a reply is explicitly requested.`,
{ swallowFailure: false }
);
expect(deps.sendAgentPrompt).not.toHaveBeenCalledWith(
"agt_target1",
expect.stringContaining(
"Reply with dispatch_send_message using the replyTarget above."
),
{ swallowFailure: false }
);
});
Expand Down
Loading