Conversation
The create request processor recognized only `createResponse`, so it released `POST /v1/responses/compact` and `POST /v1/responses/input_tokens` untouched. The validation stage it replaces handled both, which is why a migrated compact chain returned 404 for an unknown `previous_response_id` where it previously returned 400. Select operations by the request-body shape the registry already records rather than by naming one operation. Bodyless operations — fetch, delete, cancel, list input items, and the `WebSocket` handshake — are still released untouched, and that list cannot drift from the registry the way a hand-written path list would. Migrates the compact example, whose 404 exposed the gap. Tests cover both directions: the four bodyless operations publish nothing and initialize no state, and compact and input-token-count are classified and given state as the validator gave them. Restoring the create-only gate fails `other_body_bearing_responses_operations_are_processed`. Signed-off-by: Charlie Doern <cdoern@redhat.com>
The specification marks the compact and input-token-count request bodies optional, so a request without one is complete. Both the previous classifier and this processor classified the missing body as `non_json` and ran it through `on_invalid`, which returns a 400 under `reject` for a request that is actually well formed. Carry the declared body shape out of the registry match instead of a bare "has a body" flag, and release an operation whose optional body is absent before any parsing or `on_invalid` handling. An absent body is still invalid where the specification requires one, and a body that was supplied but does not parse is still invalid either way — optional means it may be omitted, not that a broken one is acceptable. This diverges from the behavior of the filters being replaced rather than reproducing it. Removing the guard fails `an_absent_optional_body_is_not_an_invalid_body`. Signed-off-by: Charlie Doern <cdoern@redhat.com>
5 tasks
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.
Progresses #741.
Problem
openai_responses_requestrecognized onlycreateResponse, so it releasedPOST /v1/responses/compactandPOST /v1/responses/input_tokensuntouched. The validation stage it replaces handled both. That is why the migrated compact chain returned 404 for an unknownprevious_response_idwhere it previously returned 400, and whycompact.yamlwas reverted from the previous PR.Change
Two commits, deliberately separate because they are different kinds of change.
Parity — process every body-bearing operation. The registry already records which operations declare a request body, so that declaration selects what is worth parsing instead of naming one operation. Bodyless operations — fetch, delete, cancel, list input items, and the
WebSockethandshake — are still released untouched, and that set can no longer drift from the registry the way a hand-written path list would.Behavior change — an absent optional body is valid. The specification marks the compact and input-token-count bodies optional, so a request without one is complete. Both the old classifier and the first commit here classified the missing body as
non_jsonand ran it throughon_invalid, which returns 400 underrejectfor a well-formed request. That is a fix, not a port: this diverges from the filters being replaced rather than reproducing them.An absent body is still invalid where the specification requires one, and a body that was supplied but does not parse is still invalid either way — optional means it may be omitted, not that a broken one is acceptable.
Verification
examples::compactpasses 17/17; that suite is what exposed the gap.Each commit is checked by reverting it in isolation and confirming exactly one test fails:
other_body_bearing_responses_operations_are_processedan_absent_optional_body_is_not_an_invalid_bodyUnit tests 4517 pass, 0 fail.
make lintpasses, including the lean build and the generated-doc sync checks.Scope
This does not close #741. Twenty-eight example configs still run
openai_responses_formatandopenai_responses_validate, and neither filter can be deleted until they are migrated. None of those configs route compact or input-token-count, so migrating them does not depend on this change and can proceed in parallel.Roughly seventeen are the same shape as the ten already migrated. The remainder need design work rather than a config swap: the Chat Completions translation chains rewrite the path away from
/v1/responses, so head-based matching does not see the operation on re-entry.Checklist
examples/configs/