refactor(conversations): drive on_request dispatch from request-body metadata - #878
Open
leseb wants to merge 1 commit into
Open
refactor(conversations): drive on_request dispatch from request-body metadata#878leseb wants to merge 1 commit into
leseb wants to merge 1 commit into
Conversation
…metadata Branch the Conversations header hook on the shared operation registry's has_request_body() metadata instead of enumerating the body-carrying operations inline, making the registry the single source of truth for body handling. Split header-phase dispatch into begin_body_operation and dispatch_read_operation helpers, both boxed so on_request keeps a small stack frame. This is the increment of praxis-proxy#742 that is unblocked today: it builds on the shared match_operation delegated to by praxis-proxy#772. Full consumption of a shared openai_operation classifier (the issue's headline) still depends on praxis-proxy#744, which has not landed. Refs: praxis-proxy#742 Signed-off-by: Sébastien Han <seb@redhat.com>
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
Branch the Conversations
on_requesthook on the shared operation registry'shas_request_body()metadata instead of enumerating the body-carrying operations (Create/Update/CreateItems) inline, so the registry is the single source of truth for request-body handling. Header-phase dispatch is split into two boxed helpers —begin_body_operation(armsStreamBufferbuffering, then dispatches a pre-read body) anddispatch_read_operation(the bodyless read handlers) — soon_requestkeeps a small stack frame. This is the increment of #742 unblocked today on top of the sharedmatch_operationdelegation landed by #772; full consumption of anopenai_operationclassifier (the issue headline) still depends on #744, which has not landed.Related issue
Refs #742 (partial — headline blocked on #744)
Validation
cargo test -p praxis-ai-apis(2586 passed, 0 failed, 27 ignored; +2 doctests)make lint— passes (clippy, nightly fmt, deps, docs, example checks)Checklist
on_request's stack frame (previously tripped thelarge_stack_frames = denyclippy gate) via boxed dispatchSigned-off-bytrailer.Breaking changes
None. The change is behavior-preserving: the same operations arm body buffering and the same read operations dispatch from the header phase; only the decision source (registry metadata vs. an inline operation list) changed.