Skip to content

Commit 8982b27

Browse files
declan-scaleclaude
andcommitted
test(tutorials): wait for state init before asserting in multiturn streaming test
The streaming test was querying client.states.list immediately after create_task returned, before the agent's on_task_create handler ran on the server. The sibling test_send_event_and_poll handles this with a 1s sleep; the streaming variant was missing it and was passing by luck on faster runners. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ac17703 commit 8982b27

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • examples/tutorials/10_async/00_base/010_multiturn/tests

examples/tutorials/10_async/00_base/010_multiturn/tests/test_agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ async def test_send_event_and_stream(self, client: AsyncAgentex, agent_id: str):
145145
task = task_response.result
146146
assert task is not None
147147

148+
await asyncio.sleep(1) # wait for state to be initialized
148149
# Check initial state
149150
states = await client.states.list(agent_id=agent_id, task_id=task.id)
150151
assert len(states) == 1

0 commit comments

Comments
 (0)