Fix agent non-streaming messaging

This commit is contained in:
Cyber MacGeddon 2026-01-12 18:26:39 +00:00
parent 69f10e50b3
commit f49b770c75
2 changed files with 14 additions and 4 deletions

View file

@ -93,6 +93,8 @@ class AgentService(FlowProcessor):
thought = None, thought = None,
observation = None, observation = None,
answer = None, answer = None,
end_of_message = True,
end_of_dialog = True,
), ),
properties={"id": id} properties={"id": id}
) )

View file

@ -232,12 +232,14 @@ class Processor(AgentService):
observation=None, observation=None,
) )
else: else:
# Legacy format # Non-streaming format
r = AgentResponse( r = AgentResponse(
answer=None, answer=None,
error=None, error=None,
thought=x, thought=x,
observation=None, observation=None,
end_of_message=True,
end_of_dialog=False,
) )
await respond(r) await respond(r)
@ -260,12 +262,14 @@ class Processor(AgentService):
observation=x, observation=x,
) )
else: else:
# Legacy format # Non-streaming format
r = AgentResponse( r = AgentResponse(
answer=None, answer=None,
error=None, error=None,
thought=None, thought=None,
observation=x, observation=x,
end_of_message=True,
end_of_dialog=False,
) )
await respond(r) await respond(r)
@ -288,12 +292,14 @@ class Processor(AgentService):
observation=None, observation=None,
) )
else: else:
# Legacy format - shouldn't be called in non-streaming mode # Non-streaming format - shouldn't normally be called
r = AgentResponse( r = AgentResponse(
answer=x, answer=x,
error=None, error=None,
thought=None, thought=None,
observation=None, observation=None,
end_of_message=True,
end_of_dialog=False,
) )
await respond(r) await respond(r)
@ -364,11 +370,13 @@ class Processor(AgentService):
thought=None, thought=None,
) )
else: else:
# Legacy format - send complete answer # Non-streaming format - send complete answer
r = AgentResponse( r = AgentResponse(
answer=act.final, answer=act.final,
error=None, error=None,
thought=None, thought=None,
end_of_message=True,
end_of_dialog=True,
) )
await respond(r) await respond(r)