cleanup component trait, access connection_cx explicitly#30
Merged
nikomatsakis merged 3 commits intoagentclientprotocol:mainfrom Nov 12, 2025
Merged
cleanup component trait, access connection_cx explicitly#30nikomatsakis merged 3 commits intoagentclientprotocol:mainfrom
nikomatsakis merged 3 commits intoagentclientprotocol:mainfrom
Conversation
- Rename Channels → Channel (singular) to represent one endpoint - Add Channel::duplex() to create connected channel pairs - Make both rx and tx use Result<Message, Error> for consistency - Add Component::serve(client) method for composing components - Add Component::into_server() to convert component to channel + future - Update connect_to() to use into_server() avoiding extra channel copies - Update all Component implementations across workspace - Update all tests to use new API This refactoring eliminates unnecessary channel copying when components are connected together, improving performance and API clarity. Co-authored-by: Claude <claude@anthropic.com>
Add comprehensive documentation covering three common usage patterns: 1. Defining reusable components with Component trait 2. Creating custom message handlers with JrMessageHandler 3. Connecting as a client with with_client Also document JrRequestCx capabilities and the importance of avoiding blocking in message handlers. Co-authored-by: Claude <claude@anthropic.com>
This change requires users to explicitly call connection_cx() when they want to perform connection-level operations (send_request, send_notification, spawn) from within a request handler. This makes the API more explicit and helps users understand when they're performing connection operations versus request-specific operations. Updated all call sites across the codebase: - sacp/src/jsonrpc.rs: Removed Deref impl and updated doc examples - sacp-proxy: Updated mcp_server.rs and to_from_successor.rs - sacp-conductor: Updated conductor.rs and initialization_sequence test - elizacp: Updated lib.rs All tests pass after this change. Co-authored-by: Claude <claude@anthropic.com>
Merged
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.
No description provided.