Question about “force-closing unterminated streaming message” and missing final response in session database #948
Replies: 1 comment
-
|
Hi @marttinslucas, Force-closing is triggered when the ADK async iteration completes but "_is_streaming" is still True. This means that the ADK stopped sending events without sending a proper "final response" event. The force-close ensures AG-UI protocol compliance by emitting a TEXT_MESSAGE_END event, but that only handles compliance from the AG-UI side - it doesn't help with ADK's own session persistence. I assume that you've tried the same scenario with streaming turned off, which I would expect to work, though that that doesn't really provide an acceptable workaround. What's interesting is the different behavior between the local and deploy environments; what are the differences between the two in your case? Presumably the same LLMs are used in both cases - the reason I mention this is that there is a known issue (fixed on main in adk-python, but not yet released) involving "finish_reason" not being set which could effect proper stream closure. There is also a known issue involving sub-agents returning empty text after tool calls, but this seems less likely. Could you share any notable differences between the local environment and deployment environment? Also, if possible, could you provide some logs with "logging.getLogger('ag_ui_adk').setLevel(logging.DEBUG)" to help narrow down the issue? In the end, though, I'm expecting that the "resolution" from the ADK Middleware side is likely to either refer back to one of the known adk-python issues or the filing of a a new one.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
I'm seeing different stream-closing behavior between local and deploy environments and would like clarification on the "force-closing unterminated streaming message" log. Locally, the stream ends with "Final response event received. Closing active stream" followed by "Streaming completed via final response", and everything works as expected.
In deploy, however, the stream ends with "Force-closing unterminated streaming message" and "Streaming state reset after force-close". When this happens, the final assistant response and the final render tool call are not persisted in my session database.
What exactly triggers a force-closing unterminated streaming message?
Is this behavior expected to discard the active streaming message?
Is an explicit final response event required to safely persist the final assistant and tool output?
google-adk==1.21.0
ag-ui-adk==0.4.0
Beta Was this translation helpful? Give feedback.
All reactions