Prevent self-directed agent messages
This commit is contained in:
1 parent
1a7eb8f1b3
commit
a4af4a866a
6 files changed
+169
No files matched your search
@@ -61,6 +61,9 @@ export function buildMessageMethods(
|
||||
if (channel === "direct" && !input.toAgentId) {
|
||||
throw new Error("Direct messages require a recipient.");
|
||||
}
|
||||
if (channel === "direct" && input.toAgentId === input.fromAgentId) {
|
||||
throw new Error("Direct messages require two distinct participants.");
|
||||
}
|
||||
const senderKind = input.senderKind
|
||||
?? (input.fromAgentId === BOARD_READER_ID ? "human" : "agent");
|
||||
const id = randomUUID();
|
||||
|
||||
Reference in new issue
Block a user