Skip to content

agentEmitter.addArtifact(message) and agentEmitter.complete(message) trigger 2 events each #1082

Description

@mescaja

i run this scenario

Turn one: client agent sends the first message. Server Agent does

agentEmitter.Submit(message1);
agentEmitter.startWork(message2);
agentEmitter.requiresInput(message3);

the client agent receive

Once taskStatusUpdateEvent for TaskState.TASK_STATE_SUBMITTED with message1
Once taskStatusUpdateEvent for TaskState.TASK_STATE_WORKING with message2
Once taskStatusUpdateEvent for TaskState.TASK_STATE_INPUT_REQUIRED with message3

all correct so far

Turn two: client agent sends the second message with the contextId and TaskId from the first turn. Server Agent does

agentEmitter.addArtifact(Parts);
agentEmitter.complete(message4);

the client agent received

twice taskArtifactUpdateEvent with the artifact
twice taskStatusUpdateEvent for TaskState.TASK_STATE_COMPLETED with message4

the issue is that the events taskArtifactUpdateEvent and taskStatusUpdateEvent are triggered twice instead of once.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions