Skip to content

fix(sdk-py): retry get_session on 503 + correct quickstart idle wait - #767

Merged
willwashburn merged 1 commit into
mainfrom
fix/py-sdk-getsession-retry-and-quickstart-idle
Apr 22, 2026
Merged

fix(sdk-py): retry get_session on 503 + correct quickstart idle wait#767
willwashburn merged 1 commit into
mainfrom
fix/py-sdk-getsession-retry-and-quickstart-idle

Conversation

@willwashburn

@willwashburnwillwashburn commented Apr 22, 2026

Copy link
Copy Markdown
Member

Summary

Two linked fixes that unblock the Python quickstart example:

  • Python SDK: AgentRelayClient.spawn() called get_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).
  • Docs: the Python quickstart referenced relay.wait_for_agent_idle(name), which doesn't exist on AgentRelay. Idle-waiting lives on the Agent handle (wait_for_idle()), mirroring the planner.waitForIdle() usage in the TypeScript example directly above it.

Test plan

  • Ran the updated quickstart Python script end-to-end — 3 agents spawned, Planner posted to #general, Coder responded, all three went idle, broker shut down with exit 0.
  • CI

Open in Devin Review

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>

@devin-ai-integrationdevin-ai-integrationBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@github-actions

Copy link
Copy Markdown
Contributor

Preview deployed!

EnvironmentURL
Webhttps://pr-767.agentrelay.net

This preview will be cleaned up when the PR is merged or closed.

@willwashburn
willwashburn merged commit 3ec26cf into mainApr 22, 2026
41 checks passed
@willwashburn
willwashburn deleted the fix/py-sdk-getsession-retry-and-quickstart-idle branch April 22, 2026 16:25
Sign up for freeto 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.

2 participants

@willwashburn@khaliqgant