What happened?
Describe the bug
After #756, streams correctly stay open for interrupted states (INPUT_REQUIRED / AUTH_REQUIRED).
However, AgentEmitter#requiresInput(Message, boolean isFinal) and requiresAuth(..., boolean isFinal) accept an isFinal flag that appears to have no effect on stream completion. Passing isFinal=true still leaves the SSE / Flow.Publisher open (subscriber onComplete is never called).
Expected behavior
Either:
requiresInput(message, true) / requiresAuth(message, true) closes the stream after the status event is delivered, or
- The
isFinal parameter is documented as not controlling stream lifecycle (and ideally removed/deprecated if unused).
Actual behavior
In 1.1.0.Final, isFinal only sets the internal terminalStateReached flag in AgentEmitter#updateStatus. It is not written onto TaskStatusUpdateEvent.
EventConsumer terminates the stream when TaskStatusUpdateEvent#isFinal() is true, but that method only delegates to TaskState#isFinal(), which is always false for INPUT_REQUIRED / AUTH_REQUIRED.
So requiresInput(msg, true) and requiresInput(msg, false) behave the same for stream completion.
Related leftover: AgentEmitter#emitEvent Javadoc still shows TaskStatusUpdateEvent.builder()...isFinal(false), but the builder no longer has isFinal(...).
Steps to reproduce
- In an
AgentExecutor, after work finishes for this turn, call:
emitter.requiresInput(replyMessage, true);
- Subscribe to
onMessageSendStream / JSON-RPC streaming response.
- Observe that events are delivered, but the publisher never completes / SSE connection stays open.
Version
Question
If keeping the stream open for interrupted states is intentional (per #756), what is the supported way for an agent to end the current stream after emitting INPUT_REQUIRED, when the client is expected to continue via a new request rather than the same open stream?
Relevant log output
Code of Conduct
What happened?
Describe the bug
After #756, streams correctly stay open for interrupted states (
INPUT_REQUIRED/AUTH_REQUIRED).However,
AgentEmitter#requiresInput(Message, boolean isFinal)andrequiresAuth(..., boolean isFinal)accept anisFinalflag that appears to have no effect on stream completion. PassingisFinal=truestill leaves the SSE /Flow.Publisheropen (subscriberonCompleteis never called).Expected behavior
Either:
requiresInput(message, true)/requiresAuth(message, true)closes the stream after the status event is delivered, orisFinalparameter is documented as not controlling stream lifecycle (and ideally removed/deprecated if unused).Actual behavior
In
1.1.0.Final,isFinalonly sets the internalterminalStateReachedflag inAgentEmitter#updateStatus. It is not written ontoTaskStatusUpdateEvent.EventConsumerterminates the stream whenTaskStatusUpdateEvent#isFinal()is true, but that method only delegates toTaskState#isFinal(), which is alwaysfalseforINPUT_REQUIRED/AUTH_REQUIRED.So
requiresInput(msg, true)andrequiresInput(msg, false)behave the same for stream completion.Related leftover:
AgentEmitter#emitEventJavadoc still showsTaskStatusUpdateEvent.builder()...isFinal(false), but the builder no longer hasisFinal(...).Steps to reproduce
AgentExecutor, after work finishes for this turn, call:onMessageSendStream/ JSON-RPC streaming response.Version
1.1.0.FinalQuestion
If keeping the stream open for interrupted states is intentional (per #756), what is the supported way for an agent to end the current stream after emitting
INPUT_REQUIRED, when the client is expected to continue via a new request rather than the same open stream?Relevant log output
Code of Conduct