Skip to content

fix(python): honor auto_restart on process exit#797

Open
haosenwang1018 wants to merge 1 commit intogithub:mainfrom
haosenwang1018:fix/python-auto-restart
Open

fix(python): honor auto_restart on process exit#797
haosenwang1018 wants to merge 1 commit intogithub:mainfrom
haosenwang1018:fix/python-auto-restart

Conversation

@haosenwang1018
Copy link

@haosenwang1018 haosenwang1018 commented Mar 12, 2026

Summary

  • route Python SDK requests through a stable request proxy so auto_restart is actually honored
  • reconnect once and retry the failed RPC when the underlying CLI process exits unexpectedly
  • keep existing CopilotSession objects wired to the refreshed transport after reconnect
  • add focused unit coverage for both the retrying and non-retrying paths

Testing

  • python -m ruff check python/copilot/client.py python/test_client.py
  • python -m pytest python/test_client.py -q

Closes #789.

@haosenwang1018 haosenwang1018 requested a review from a team as a code owner March 12, 2026 04:34
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.

Python has an auto_restart argument for CopilotClient, but it is never used

1 participant