Skip to content

agents: add external-provider OAuth connection methods - #755

Open
jkosanam wants to merge 1 commit into
digitalocean:mainfrom
jkosanam:jkosanam/hosted-agents-connections
Open

jkosanam wants to merge 1 commit into
digitalocean:mainfrom
jkosanam:jkosanam/hosted-agents-connections

Conversation

@jkosanam

@jkosanam jkosanam commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Adds actor-scoped OAuth connection management to the hand-written hosted-agents client, completing the pydo side of MARSOHS-2070 (godo and doctl already carry the same surface).

What this adds

Four methods on both the sync (SessionsOperations) and async (aio) clients, surfaced as client.agents.sessions.*:

Method Call
list_connections(provider, *, user_id=, status=, page=, per_page=) GET /v2/agents/auth/{provider}/connections
create_connection(provider, *, user_id, scopes=None) POST .../connections
get_connection(provider, connection_id) GET .../connections/{id}
delete_connection(provider, connection_id) DELETE .../connections/{id}

These sit in the hand-written custom layer next to the existing start_provider_auth / poll_provider_auth, matching the actor-scoped connection shape harness-api proxies (field names mirror tool-registry's public connection: user_id is the actor, status is pending/active/expired).

Scope / compatibility

Additive only (432 insertions, 0 deletions). The legacy team-wide start_provider_auth / poll_provider_auth flow is untouched.

Testing

  • 14 new unit tests (7 sync + 7 async) covering filter forwarding, create body, get/delete paths, and required-argument validation.
  • Full sync + async session suites pass (94 tests).
  • black clean; source within the 88-char pylint limit.

Made with Cursor

Add actor-scoped OAuth connection management to the hand-written hosted-agents
layer, mirroring the godo/doctl surface (MARSOHS-2070):

  list_connections / create_connection / get_connection / delete_connection

on both the sync (SessionsOperations) and async (aio) clients, targeting
/v2/agents/auth/{provider}/connections[/{id}]. Additive only; the legacy
start_provider_auth / poll_provider_auth flow is untouched.
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.

2 participants