Surface auto_start on ez.run() - #258
Open
cboulay wants to merge 1 commit into
Open
Conversation
…ut it does not exist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Exposes the existing
auto_startoption on the publicez.run()/GraphRunnerAPI.The
auto_startmechanism already exists lower in the stack —GraphContext(auto_start=...)→GraphServer.ensure(auto_start=...)decides whether to spawn aGraphServerwhen none is reachable at a givengraph_address, and it's already plumbed throughsync.pyandhotpath.py. Butez.run()had no way to pass it through, so callingrun()with an explicitgraph_addresswould refuse to start a server even when the caller wanted one.This adds
auto_start: bool | NonetoGraphRunner.__init__andrun(), threads it intocreate_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=Trueso 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 explicitgraph_addressis 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 withauto_start=Trueand asserts all messages are delivered.🤖 Generated with Claude Code