Skip to content

refactor(conversations): drive on_request dispatch from request-body metadata - #878

Open
leseb wants to merge 1 commit into
praxis-proxy:mainfrom
leseb:leseb/issue-742
Open

refactor(conversations): drive on_request dispatch from request-body metadata#878
leseb wants to merge 1 commit into
praxis-proxy:mainfrom
leseb:leseb/issue-742

Conversation

@leseb

@leseb leseb commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Branch the Conversations on_request hook on the shared operation registry's has_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 (arms StreamBuffer buffering, then dispatches a pre-read body) and dispatch_read_operation (the bodyless read handlers) — so on_request keeps a small stack frame. This is the increment of #742 unblocked today on top of the shared match_operation delegation landed by #772; full consumption of an openai_operation classifier (the issue headline) still depends on #744, which has not landed.

Related issue

Refs #742 (partial — headline blocked on #744)

Validation

  • Unit tests — cargo test -p praxis-ai-apis (2586 passed, 0 failed, 27 ignored; +2 doctests)
  • Integration or functional tests — N/A: behavior-preserving refactor, no new capability; covered by the existing crate suite
  • make lint — passes (clippy, nightly fmt, deps, docs, example checks)

Checklist

  • I reviewed every changed line and can explain the change.
  • New capabilities include an example config and functional example test. — N/A (internal refactor, no new capability)
  • User-facing behavior and generated documentation are updated. — N/A (no user-facing or documented behavior change)
  • Performance-sensitive changes include appropriate benchmark or load-test evidence. — N/A: neutral-to-positive; shrinks on_request's stack frame (previously tripped the large_stack_frames = deny clippy gate) via boxed dispatch
  • Commits are signed and include a Signed-off-by trailer.

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.

…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>
@leseb
leseb requested review from a team and jland-redhat September 2, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant