refactor(core,tools): box large LoopbackEvent variants and remove async-trait from zeph-tools#1757
Merged
refactor(core,tools): box large LoopbackEvent variants and remove async-trait from zeph-tools#1757
Conversation
…nc-trait from zeph-tools Extract ToolStartData and ToolOutputData owned structs and box them in LoopbackEvent::ToolStart/ToolOutput variants, reducing the base enum size from ~200+ bytes to a single pointer per boxed variant. Update all six construction and match sites across zeph-core, zeph-acp, and the daemon. Replace async-trait macro usage in SemanticSearchBackend and LspSearchBackend with native Pin<Box<dyn Future<...> + Send + 'a>> return types for object safety. Update all implementations in agent_setup.rs. Remove async-trait from zeph-tools/Cargo.toml (zeph-acp retains it, required by the ACP SDK). Closes #1737, closes #1733.
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
ToolStartDataandToolOutputDataowned structs; box them inLoopbackEvent::ToolStart(Box<ToolStartData>)andToolOutput(Box<ToolOutputData>)to reduce the enum's stack footprint from ~200+ bytes to a single pointer per boxed variant (Box large LoopbackEvent variants to reduce enum size #1737)async-traitmacro inSemanticSearchBackend/LspSearchBackendwith nativePin<Box<dyn Future<...> + Send + 'a>>return types for object-safe dynamic dispatch; removeasync-traitfromzeph-tools/Cargo.toml(Replace async-trait with native async traits in zeph-tools/search_code.rs #1733)zeph-acpretainsasync-trait(required by the ACP SDK) — documented as accepted exceptionFiles changed
crates/zeph-core/src/channel.rs— struct definitions, enum variant changes,LoopbackChannelsend methodscrates/zeph-core/src/lib.rs— re-export new public typescrates/zeph-acp/src/agent/helpers.rs,mod.rs,tests.rs— update all match/construction sitescrates/zeph-core/src/agent/tool_execution/mod.rs— update test match sitessrc/daemon.rs— update wildcard matchcrates/zeph-tools/src/search_code.rs— native async trait signaturessrc/agent_setup.rs—Box::pin(async move { ... })implementationscrates/zeph-tools/Cargo.toml— removeasync-traitdependencyTest plan
cargo +nightly fmt --check— passcargo clippy --workspace --features full -- -D warnings— pass (0 warnings)cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 5427 passed, 0 failed, 12 skippedCloses #1737, closes #1733. Part of epic #1741 (arch phase 3).