refactor: unify response processing under AgentPipeline - #274
Merged
Conversation
- Unify JSON and live SSE ingestion under AgentPipeline - Move accumulation, stream delivery, and request state into the pipeline - Add tool-specific translators with an inline dispatcher - Move response restoration from ToolRegistry into translation - Keep tool-search state in the pipeline and lookup validation in the registry - Encapsulate tool-loop orchestration in EngineOrchestration - Expand coverage for translation, streaming, and state ownership Signed-off-by: maral <maralbahari.98@gmail.com>
Signed-off-by: maral <maralbahari.98@gmail.com>
Signed-off-by: maral <maralbahari.98@gmail.com>
Signed-off-by: maral <maralbahari.98@gmail.com>
maralbahari
marked this pull request as ready for review
September 10, 2026 03:24
maralbahari
requested review from
bbrowning,
franciscojavierarceo,
jiahuei,
leseb,
noobHappylife,
qandrew and
tjtanaa
as code owners
September 10, 2026 03:24
franciscojavierarceo
approved these changes
Sep 11, 2026
franciscojavierarceo
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed ingestion, streaming delivery, tool translation, and persistence boundaries at e03fb7e. No actionable regressions found. Validation: 877 core tests and 19 split-execution tests passed; 9 tests were ignored. Cassette replay coverage passed; live providers were not tested.
Signed-off-by: maral <maralbahari.98@gmail.com>
Signed-off-by: maral <maralbahari.98@gmail.com>
This was referenced Sep 11, 2026
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
The Responses executor previously split JSON/SSE accumulation, tool-call translation, and stream emission across
upstream.rs,accumulator.rs, andfunction_sse.rs. This made ownership unclear and allowed live and collected responses to follow different processing paths.This PR implements #243 from RFC #241 by introducing a request-owned
AgentPipeline:RoundIngestionthat combines typed response accumulation with tool-call translation.ResponseAccumulatorinto focused modules with typed active/completed slots keyed by validatedoutput_index.ToolRegistryas the request-scoped lookup for available tools and their client/gateway ownership. Translators consume an owned classification snapshot.AgentPipeline, preserving cross-round sequencing, output-index rebasing, deferred event ordering, and downstream backpressure.EngineOrchestration.upstream.rsfocused on request serialization, inference transport, response-budget accounting, and selecting the JSON or SSE pipeline runner.OutputItem::to_input_itemas the continuation conversion policy.Closes #243.
Part of #241.
Test Plan
cargo test --locked --workspace -- --test-threads=2cargo clippy --locked --workspace --all-targets -- -D warningsgit diff --check