refactor(cua-sandbox): use generated Cyclops SDK for Fleet cloud transport - #2398
Merged
Conversation
(cherry picked from commit c13ef81)
(cherry picked from commit bcaf20d)
(cherry picked from commit d6213df)
(cherry picked from commit a4255e7)
(cherry picked from commit d12a914)
- raise a typed Fleet snapshot error\n- route OAuth lifecycle and reconnects through Fleet\n- keep Fleet readiness waits off the event loop\n- preserve cleanup handles until successful deletion\n- retain provisioning failures when cleanup also fails\n- split Fleet and legacy API base URLs\n- preserve API-key creation through the legacy VM API\n- reject unsupported Fleet disk and region arguments and honor startup timeouts\n- return Fleet service endpoints for exposed ports (cherry picked from commit 9192140)
(cherry picked from commit ea01366)
…ting (cherry picked from commit d7cb2e2)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Replaces the handwritten
_FleetClientREST implementation from #2384 with an adapter around the generated Cyclops Python SDK (cyclops_sdk), merged in trycua/cloud#5905.What changed
cyclops_sdkunderlib/fleets/(origin: cloud PR #5905, commit 239a06064), with local package metadata and README documenting the source.cyclops_http_client.py— anHttpClientsubclass bridging the SDK'sHttpRequest/HttpResponsetypes tohttpx.AsyncClient.fleet_cloud.py— replaces rawhttpxREST calls, manual OAuth token POST, polling loops, andasyncio.to_threadwrappers with typed SDK calls (CyclopsClient.connect,create_pool,create_claim,wait_claim,delete_claim,delete_pool,service_request).fleet.py— routes computer-server traffic (/cmd,/screenshot,/status,/pty) throughservice_requestinstead ofservice_client.CyclopsClient/HttpClient) instead of rawhttpxendpoints.pyproject.toml; documented native cdylib build requirement.What's preserved
cua.configure(client_id=..., client_secret=...),Sandbox.create/ephemeral,Image.from_registry(...).expose(...),TunnelInfowith Fleet service URLs.CloudTransport(API-key VM) path untouched.us-east-1-only restriction.-xattribution.Validation
git diff --check— cleanruff checkon changed transport and test files — passedcua-sandboxpytest blocked locally (missingPython.hforevdevtransitive build)Supersedes #2384.
Test Plan