Skip to content

fix: propagate client connection errors and check capability value truthiness#108

Merged
benbrandt merged 5 commits intoagentclientprotocol:mainfrom
anaslimem:connection-errors-and-capability-checks
May 1, 2026
Merged

fix: propagate client connection errors and check capability value truthiness#108
benbrandt merged 5 commits intoagentclientprotocol:mainfrom
anaslimem:connection-errors-and-capability-checks

Conversation

@anaslimem
Copy link
Copy Markdown
Contributor

Two bugs fixed :

  1. Connection errors swallowed (mcp_server/builder.rs)

    • McpServerConnection::connect_to was dropping the client connection result and always returning Ok(())
    • Now properly propagates connection failures so the caller knows the connection failed
  2. Capability checks incorrect (capabilities.rs)

    • has_meta_capability only checked key presence, returning true even for explicit false or null values
    • Now checks for actual boolean true value via as_bool().unwrap_or(false)

Comment thread src/agent-client-protocol-core/src/capabilities.rs Outdated
@anaslimem
Copy link
Copy Markdown
Contributor Author

@benbrandt Fixed! Changed to check for any non-null, non-false value so objects {} are now detected correctly. PTAL when you get a chance.

@nikomatsakis
Copy link
Copy Markdown
Contributor

Hey @anaslimem -- I didn't realize this PR was here. I think that #114 fixed the first problem you identified, right? Any chance you can rebase and we can tackle the second?

@anaslimem
Copy link
Copy Markdown
Contributor Author

Hello @nikomatsakis I have merged main into this branch. Also i think it is not the same as #114 Because each PR fixed something

Comment thread src/agent-client-protocol/src/capabilities.rs
Comment thread src/agent-client-protocol/src/mcp_server/builder.rs Outdated
Comment thread src/agent-client-protocol/src/capabilities.rs
@benbrandt benbrandt enabled auto-merge (squash) May 1, 2026 10:24
@benbrandt benbrandt merged commit 0396650 into agentclientprotocol:main May 1, 2026
2 checks passed
@acp-release-bot acp-release-bot Bot mentioned this pull request May 1, 2026
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.

3 participants