refactor(acp): migrate connection layer to sacp v10#380
Merged
Conversation
….9 to sacp v10 Replace the old AcpConnection (which required a dedicated worker thread due to !Send futures) with SacpConnection using sacp v10's Send + Sync ClientToAgent. This eliminates the worker thread, command channel, ClientDelegate trait impl, and spawn_blocking for drop. Key changes: - New SacpConnection using ClientToAgent::builder() with chained on_receive_request handlers for permissions, file writes, file reads - Dynamic session update routing via Arc<Mutex<Option<Sender>>> - Approval flow uses cx.spawn() to avoid blocking dispatch - Process group isolation and cleanup preserved - 7 integration tests for the new connection layer - All E2E tests pass (69/70 with 1 pre-existing failure) - Net reduction of ~266 lines of code 🤖 Generated with [Nori](https://usenori.ai) Co-Authored-By: Nori <contact@tilework.tech>
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
🤖 Generated with Nori
agent-client-protocolv0.9 connection layer (AcpConnection+ dedicated worker thread) withsacpv10SacpConnectionthat runs directly on the main tokio runtime, eliminating ~266 lines of complexityWriteTextFileRequestandReadTextFileRequesthandlers as chained.on_receive_request()calls with the same workspace security boundaries as the oldClientDelegatetest_startup_error_for_unregistered_model)Architecture Changes
ClientToAgentisSend + Sync, so all operations run on the main tokio runtimeClientToAgent::builder().on_receive_request()chains instead of aClienttrait implementationArc<Mutex<Option<Sender<SessionUpdate>>>>swaps between prompt-active and persistent channelsSacpConnection::drop()aborts tasks and kills the process group withoutspawn_blockingFiles
sacp_connection.rs(connection impl),sacp_connection_tests.rs(7 integration tests)client_delegate.rs,public_api.rs,worker.rs,tests.rs(old connection layer)backend/*.rs(AcpConnection→SacpConnection),translator.rs,lib.rs,Cargo.toml,docs.mdTest Plan
test_startup_error_for_unregistered_model)Share Nori with your team: https://www.npmjs.com/package/nori-skillsets