Title: bug: `on_connect` arg is `AgentSideConnection` at runtime while methods and params are different than `Client` · Issue #49 · agentclientprotocol/python-sdk · GitHub
Open Graph Title: bug: `on_connect` arg is `AgentSideConnection` at runtime while methods and params are different than `Client` · Issue #49 · agentclientprotocol/python-sdk
X Title: bug: `on_connect` arg is `AgentSideConnection` at runtime while methods and params are different than `Client` · Issue #49 · agentclientprotocol/python-sdk
Description: Summary Type Client and AgentSideConnection are not the same, while on_connect params is a Client, it is a AgentSideConnection at runtime ( python-sdk/src/acp/core.py Line 59 in 4cc2dfd conn = AgentSideConnection( ) There is a cast force...
Open Graph Description: Summary Type Client and AgentSideConnection are not the same, while on_connect params is a Client, it is a AgentSideConnection at runtime ( python-sdk/src/acp/core.py Line 59 in 4cc2dfd conn = Agen...
X Description: Summary Type Client and AgentSideConnection are not the same, while on_connect params is a Client, it is a AgentSideConnection at runtime ( python-sdk/src/acp/core.py Line 59 in 4cc2dfd conn = Agen...
Opengraph URL: https://github.com/agentclientprotocol/python-sdk/issues/49
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: `on_connect` arg is `AgentSideConnection` at runtime while methods and params are different than `Client`","articleBody":"### Summary\n\nType `Client` and `AgentSideConnection` are not the same, while `on_connect` params is a `Client`, it is a `AgentSideConnection` at runtime (https://github.com/agentclientprotocol/python-sdk/blob/4cc2dfdbeebc224db92de92ce308a1820f7f42f1/src/acp/core.py#L59)\n\nThere is a cast forced here\n\nhttps://github.com/agentclientprotocol/python-sdk/blob/main/src/acp/agent/connection.py#L64\n\nWhen using `Client`, there are method such as `create_terminal` that does not return the same values nor property\n\nI really like the move to snake case, but I think it added a lot of breaking changes, especially to load the Agent. Shouldn't this release have been a major ?\n\n### Reproduction steps\n\n```python\nclass ExampleAgent(Agent)\n #...\n\n @override\n def on_connect(self, conn: Client) -\u003e None:\n self.client = conn\n # ^ this is AgentSideConnection at runtime\n```\n\n```python\n terminal_handle = await client.create_terminal(...)\n print(terminal_handle.terminal_id)\n # ^ this break because terminal_handle is not `CreateTerminalResponse` with `terminal_id` but `TerminalHandle` with `id`\n```\n\nAlso, having `Client` and `AgentSideConnection` being different type with no inheritence + `AgenceSideConnection` being now final make the test harder to write, especially when you need to stub `AgentSideConnection`\n\n### Expected result\n\n`Client` and `AgentSideConnection` should have similar property so that the types expected at runtime are the same. I'd expect `on_connect` to receive an `AgentSideConnection` instead of `Client` which is a protocol\n\n### Actual result\n\n```python\nclass ExampleAgent(Agent)\n #...\n\n @override\n def on_connect(self, conn: Client) -\u003e None:\n self.client = conn\n # ^ this is AgentSideConnection at runtime\n```\n\n```python\n terminal_handle = await client.create_terminal(...)\n print(terminal_handle.terminal_id)\n # ^ this break because terminal_handle is not `CreateTerminalResponse` with `terminal_id` but `TerminalHandle` with `id`\n\n```\n\n\n### Versions / environment\n\nsdk 0.7.0, Python 3.12, macOS 15.7.3\n\n\nQuick fix for now is to force cast `Client` into `AgentSideConnection`","author":{"url":"https://github.com/Nemtecl","@type":"Person","name":"Nemtecl"},"datePublished":"2025-12-18T19:25:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/49/python-sdk/issues/49"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e7635514-beec-5163-5236-46785ad24a42 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98F2:37FA71:8B58BA1:BACEB6A:6980E97D |
| html-safe-nonce | 3cc2c0538341038f84b1c06c261db208facec2d5984d711b0922152190b12377 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEYyOjM3RkE3MTo4QjU4QkExOkJBQ0VCNkE6Njk4MEU5N0QiLCJ2aXNpdG9yX2lkIjoiMzYwNzc2NDgxMjM1MzgyNTE0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b4a2cb436f6da67b1597c797f063621e70db42a22d7d7df0f43ebe44d3542de2 |
| hovercard-subject-tag | issue:3744528880 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/agentclientprotocol/python-sdk/49/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2e6c79fc67f8ba2b24be708ffa81b48da0305bfa95e59c908e214857ef66c540/agentclientprotocol/python-sdk/issues/49 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2e6c79fc67f8ba2b24be708ffa81b48da0305bfa95e59c908e214857ef66c540/agentclientprotocol/python-sdk/issues/49 |
| og:image:alt | Summary Type Client and AgentSideConnection are not the same, while on_connect params is a Client, it is a AgentSideConnection at runtime ( python-sdk/src/acp/core.py Line 59 in 4cc2dfd conn = Agen... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Nemtecl |
| hostname | github.com |
| expected-hostname | github.com |
| None | aaf8d4a8e86300179375c44c83488bc74585c21f81b72377699d5e6c4b00d1b1 |
| turbo-cache-control | no-preview |
| go-import | github.com/agentclientprotocol/python-sdk git https://github.com/agentclientprotocol/python-sdk.git |
| octolytics-dimension-user_id | 235308037 |
| octolytics-dimension-user_login | agentclientprotocol |
| octolytics-dimension-repository_id | 1051445009 |
| octolytics-dimension-repository_nwo | agentclientprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1051445009 |
| octolytics-dimension-repository_network_root_nwo | agentclientprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0b50c4d33bc796ea7d05dba2f7cf29956c2e8265 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width