feat(server): add stateless OpenAI Responses API - #32
Open
Iwctwbh wants to merge 1 commit into
Open
Conversation
Add non-streaming and typed SSE Responses output on the existing chat dispatch path, including function-tool round trips, request metadata, cached-token usage, and explicit errors for unsupported stateful or multimodal features.
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
POST /v1/responsesas a stateless compatibility layer over the existing chat dispatch pathfunction_call, andfunction_call_outputinput itemsinstructions, tools, tool choice, token limit, temperature, top-p, text verbosity, metadata) in response objectsinput_tokens_detailsExplicit capability boundaries
Unsupported semantics return an OpenAI-shaped 400 instead of being silently ignored:
previous_response_id,conversation, andstore=truetruncation="auto"parallel_tool_calls=falseThe supported path is deliberately stateless: clients replay prior message and function-call items in
inputand usestore=false.Protocol compatibility
The SSE order and object shapes follow the official OpenAI Responses lifecycle for text and function calls:
response.created/response.in_progressresponse.output_item.addedresponse.output_item.doneresponse.completedorresponse.incompleteReference: https://developers.openai.com/api/reference/typescript/resources/beta/subresources/responses/methods/create
I also checked the lifecycle against the local DeepSeek Harness Responses fixture at
cd5ef81481; focused tests cover both its text and function-call flows.Scope
Extracted from #6 and rebuilt on current
main(3901476d). This PR contains no metrics endpoint and noToolCallStartchange.Verification
cargo check --workspace --all-targetscargo test -p infr-server -p infr-chat(94 + 58 unit tests, plus 5 integration tests)cargo fmt --checkgit diff --checkClippy was not run because the current Rust toolchain does not have the Clippy component installed.