Uh oh!
There was an error while loading. Please reload this page.
fix(sdk-py): retry get_session on 503 + correct quickstart idle wait - #767
Merged
willwashburn merged 1 commit intoApr 22, 2026
Merged
Conversation
The Python SDK's spawn() called get_session() once, so any 503 while the broker was still connecting to Relaycast killed the client before the first agent could spawn. Mirror the TypeScript SDK's retry-on-503 loop (10 attempts, 1s backoff). The quickstart Python example also referenced a non-existent relay.wait_for_agent_idle(name); switch to <handle>.wait_for_idle() to match the TypeScript example above it. Verified end-to-end: 3 agents spawn, exchange a kickoff message, go idle, broker shuts down cleanly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Preview deployed!
This preview will be cleaned up when the PR is merged or closed. |
khaliqgant
approved these changes
Apr 22, 2026
Closed
9 tasks
Uh oh!
There was an error while loading. Please reload this page.
willwashburn
deleted the
fix/py-sdk-getsession-retry-and-quickstart-idle
branch
April 22, 2026 16:25
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 freeto 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
Two linked fixes that unblock the Python quickstart example:
AgentRelayClient.spawn()calledget_session()exactly once. If the broker is still connecting to Relaycast it returns 503, which killed the client before any agent could spawn. Mirror the TypeScript SDK's retry-on-503 loop (10 attempts, 1s backoff —packages/sdk/src/client.ts:265-279).relay.wait_for_agent_idle(name), which doesn't exist onAgentRelay. Idle-waiting lives on theAgenthandle (wait_for_idle()), mirroring theplanner.waitForIdle()usage in the TypeScript example directly above it.Test plan
#general, Coder responded, all three went idle, broker shut down with exit 0.