Agent messaging unit & contract tests

This commit is contained in:
Cyber MacGeddon 2026-01-12 18:39:14 +00:00
parent 45ff3fa162
commit 91f798402f
2 changed files with 5 additions and 5 deletions

View file

@ -39,7 +39,7 @@ class TestAgentServiceNonStreaming:
async def mock_react(question, history, think, observe, answer, context, streaming):
await think("I need to solve this.", is_final=True)
await observe("The answer is 4.", is_final=True)
return Final("4")
return Final(thought="Final answer", final="4")
mock_agent_instance.react = mock_react
@ -115,7 +115,7 @@ class TestAgentServiceNonStreaming:
# Mock react to return Final directly
async def mock_react(question, history, think, observe, answer, context, streaming):
return Final("4")
return Final(thought="Final answer", final="4")
mock_agent_instance.react = mock_react

View file

@ -48,13 +48,13 @@ class AgentService(FlowProcessor):
async def on_request(self, msg, consumer, flow):
# Get ID early so error handler can use it
id = msg.properties().get("id", "unknown")
try:
request = msg.value()
# Sender-produced ID
id = msg.properties()["id"]
async def respond(resp):
await flow("response").send(