Skip to content

Commit

Permalink
Fix agent channel emitting
Browse files Browse the repository at this point in the history
  • Loading branch information
parzival418 committed Nov 22, 2024
1 parent 7e94545 commit 828c6ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/server/agents/src/lib/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ type ChannelEvents = {
class Channel extends (EventEmitter as new () => TypedEmitter<ChannelEvents>) {
constructor(private channelId: string, private agent: Agent) {
super()
this.agent = agent
}

emit<K extends keyof ChannelEvents>(
Expand All @@ -106,7 +107,7 @@ class Channel extends (EventEmitter as new () => TypedEmitter<ChannelEvents>) {
...data,
channel: this.channelId,
}
return super.emit(event, ...([eventData] as Parameters<ChannelEvents[K]>))
return this.agent.emit(event, eventData)
}
}

Expand Down

0 comments on commit 828c6ce

Please sign in to comment.