Skip to content

Surface auto_start on ez.run() - #258

Open
cboulay wants to merge 1 commit into
devfrom
cboulay/surface_auto_start
Open

Surface auto_start on ez.run()#258
cboulay wants to merge 1 commit into
devfrom
cboulay/surface_auto_start

Conversation

@cboulay

@cboulay cboulay commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

Exposes the existing auto_start option on the public ez.run() / GraphRunner API.

The auto_start mechanism already exists lower in the stack — GraphContext(auto_start=...)GraphServer.ensure(auto_start=...) decides whether to spawn a GraphServer when none is reachable at a given graph_address, and it's already plumbed through sync.py and hotpath.py. But ez.run() had no way to pass it through, so calling run() with an explicit graph_address would refuse to start a server even when the caller wanted one.

This adds auto_start: bool | None to GraphRunner.__init__ and run(), threads it into create_graph_context(), and documents the semantics.

Motivation

Lets a parent process pick an ephemeral port and hand it to a child that owns the graph: the child binds to that explicit address and passes auto_start=True so it spawns the server rather than expecting one to already exist.

Behavior

  • auto_start=None (default): unchanged — a server is auto-started only when no explicit graph_address is given and no environment override is set.
  • auto_start=True: force auto-start even when binding to a specific address.

Tests

Adds test_run_auto_start_with_explicit_address, which runs a pub/sub graph on an explicit ephemeral port with auto_start=True and asserts all messages are delivered.

🤖 Generated with Claude Code

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