Compare commits
1 Commits
cf9be60145
...
39b758f13a
| Author | SHA1 | Date | |
|---|---|---|---|
| 39b758f13a |
5
dist/whispergate/index.ts
vendored
5
dist/whispergate/index.ts
vendored
@@ -932,14 +932,9 @@ export default {
|
||||
}
|
||||
|
||||
// Extract content from event.message (AgentMessage)
|
||||
// Only process assistant messages — before_message_write fires for both
|
||||
// user (incoming) and assistant (outgoing) messages. Incoming messages may
|
||||
// contain end symbols from OTHER agents, which would incorrectly advance the turn.
|
||||
let content = "";
|
||||
const msg = (event as Record<string, unknown>).message as Record<string, unknown> | undefined;
|
||||
if (msg) {
|
||||
const role = msg.role as string | undefined;
|
||||
if (role && role !== "assistant") return;
|
||||
// AgentMessage may have content as string or nested
|
||||
if (typeof msg.content === "string") {
|
||||
content = msg.content;
|
||||
|
||||
@@ -932,14 +932,9 @@ export default {
|
||||
}
|
||||
|
||||
// Extract content from event.message (AgentMessage)
|
||||
// Only process assistant messages — before_message_write fires for both
|
||||
// user (incoming) and assistant (outgoing) messages. Incoming messages may
|
||||
// contain end symbols from OTHER agents, which would incorrectly advance the turn.
|
||||
let content = "";
|
||||
const msg = (event as Record<string, unknown>).message as Record<string, unknown> | undefined;
|
||||
if (msg) {
|
||||
const role = msg.role as string | undefined;
|
||||
if (role && role !== "assistant") return;
|
||||
// AgentMessage may have content as string or nested
|
||||
if (typeof msg.content === "string") {
|
||||
content = msg.content;
|
||||
|
||||
Reference in New Issue
Block a user