Skip to content

fix: start agents before submitting intent to avoid SSE race#74

Merged
George-iam merged 1 commit intomainfrom
fix/examples-agent-race-20260324
Mar 24, 2026
Merged

fix: start agents before submitting intent to avoid SSE race#74
George-iam merged 1 commit intomainfrom
fix/examples-agent-race-20260324

Conversation

@George-iam
Copy link
Contributor

Summary

  • Reorder example execution: agents start listening (step 3) before scenarios apply creates the intent (step 4)
  • Previously agents started after the intent was created — SSE init phase would skip past the delivery event, causing the agent to never process it
  • Added 500ms settle time after agent SSE connections start
  • Especially visible on macOS where network latency is higher than local Linux dev

Test plan

  • axme examples run delivery/stream on macOS — completes without hanging
  • axme examples run full/multi-agent on macOS — both agents process promptly
  • axme examples run human/cli — still works (has agent + human step)
  • go test ./... passes

The SSE init phase skips all existing events to find the cursor.
When the intent was created BEFORE agents started listening, the
init phase would skip past the delivery event — causing the agent
to never process it. This was especially visible on macOS where
network latency to the cloud server is higher.

Now agents start listening (step 3) before scenarios apply (step 4),
with a 500ms settle time to ensure SSE connections are established.
@George-iam George-iam merged commit 2f78132 into main Mar 24, 2026
1 check passed
@George-iam George-iam deleted the fix/examples-agent-race-20260324 branch March 24, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant