[PR #630] [CLOSED] serve: add opt-in stateless Responses API #2731

Closed
opened 2026-11-04 02:02:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/630
Author: @CC-David-CC
Created: 10/3/2026
Status: ❌ Closed

Base: main ← Head: work/responses-api


📝 Commits (9)

  • 0fc5140 responses R0: pin client capture and upstream baseline evidence
  • 88a63bc responses R1: add stateless request boundary and local assembler
  • 53c4f9f responses R2: stream typed events and verify cancellation cleanup
  • 5cb5746 Support client-owned functions and honest Responses reasoning
  • 9609267 Qualify the Responses client profile and freeze R4 acceptance
  • 46a44c5 Record the exact passing R4 checkpoint receipt
  • f262838 Preserve literal tool markup in Responses reasoning summaries
  • 8258746 Distinguish literal tool markers from function call preambles
  • 116da0c Document parser fixes and Responses regression checkpoint

📊 Changes

159 files changed (+30244 additions, -7 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 README.md (+3 -0)
➕ docs/RESPONSES.md (+206 -0)
➕ docs/responses-evidence/R0/REPORT.md (+88 -0)
➕ docs/responses-evidence/R0/baseline/serve-test_detok.txt (+13 -0)
➕ docs/responses-evidence/R0/baseline/serve-test_lifecycle.txt (+25 -0)
➕ docs/responses-evidence/R0/baseline/serve-test_mcp.txt (+89 -0)
➕ docs/responses-evidence/R0/baseline/serve-test_monitor.txt (+30 -0)
➕ docs/responses-evidence/R0/baseline/serve-test_security.txt (+26 -0)
➕ docs/responses-evidence/R0/baseline/serve-test_server.txt (+311 -0)
➕ docs/responses-evidence/R0/baseline/serve-test_structured.txt (+37 -0)
➕ docs/responses-evidence/R0/baseline/test-results.json (+86 -0)
➕ docs/responses-evidence/R0/capture-attempt-1.json (+34 -0)
➕ docs/responses-evidence/R0/client-profile.json (+34 -0)
➕ docs/responses-evidence/R0/codex-capture-output.txt (+6 -0)
➕ docs/responses-evidence/R0/codex-profile.toml (+12 -0)
➕ docs/responses-evidence/R0/handoff-checks.json (+41 -0)
➕ docs/responses-evidence/R0/handoff-pack.txt (+1 -0)
➕ docs/responses-evidence/R0/handoff-tests-utf8.txt (+58 -0)
➕ docs/responses-evidence/R0/handoff-tests.txt (+78 -0)

...and 80 more files

📄 Description

Related to #451.

Adds an experimental stateless POST /v1/responses adapter for clients such as Codex. Text, reasoning, function calls and client-owned tool results pass through the existing Strata service. One request-local assembler produces final JSON and typed SSE with stable item IDs, indexes and sequence numbers.

This is a bounded compatibility profile. Unsupported behavior is rejected explicitly. This draft needs the accounting and replay-contract follow-ups below before it is ready to merge.

Behavior and ownership

  • Calls Service.run() directly, consuming semantic parser events. Existing FIFO admission, model execution, authentication, CORS, cancellation and engine-output draining remain in use.
  • Supports content-bearing input history, per-request instructions, explicit store:false, non-strict functions including namespaces, matching function_call_output items, visible reasoning, separately generated summaries and authenticated Strata-issued replay tokens.
  • Keeps response state request-local. The client supplies history; no state is inferred from GPU cache. No new serving framework or native/MTP changes are included.
  • Includes a small existing /load and /unload fix: consume bounded request bodies before replying. The Windows connection-reset failure was also reproduced against the selected upstream base; the R4 report records it.

Enablement

Disabled by default. Install requirements-responses.txt, supply a stable STRATA_RESPONSES_REPLAY_KEY in the server environment, and start the existing configured server with --experimental-responses or top-level config "experimental_responses": true. Use the existing API-key configuration. Disabled startup imports no optional crypto dependency and leaves /v1/responses unavailable.

Clients use the ordinary Responses endpoint with explicit store:false; no experimental request field is needed. The guide describes setup, continuation, the tested Codex profile and capability limits.

Validation and its limits

  • Recorded R4 CPU/MockEngine regression checkpoint: 235 passed, five optional detokenizer skips. The final environment-key check passed all 44 Responses tests. R4 report and commands.
  • Official openai==3.23.0: JSON, typed streaming and assembly, namespaced function/result replay, reasoning and authenticated replay. Process-restart checks verify replay with the same deployment key and no stored response files.
  • Codex CLI 0.160.0 performed a real local read/edit/verify loop over four requests with three successful tool results. The model output in that protocol test was scripted MockEngine output. Client receipt.
  • Additional native evidence exists on the GBNF follow-up: pinned local Codex received Hello world from a real Coder IQ1_M model on an RTX 4090 over LAN, including real reasoning and a generated summary. It did not call tools. This validates the combined follow-up configuration, not an isolated native test of this PR. Native receipt.

The source audit verifies no native/build changes against upstream 99f3dbd0b21d1401b3769e0c0d963913607f380b. These results cover the recorded client/profile and do not establish compatibility with every Codex version or a complete native coding workflow.

Excluded capabilities

No retained-response CRUD, previous_response_id, background execution/cancel endpoint, compaction, media, hosted tools or WebSockets. Strict/omitted-strict functions, JSON Schema/JSON-object output and custom/Lark tools are rejected. Raw GBNF belongs to a separate native contribution and is not needed to use this adapter. Reasoning summaries require another generation pass and count toward the output allowance.

Before merge

  • Correct original-prompt cache accounting when the shared service wraps a reasoning-budget continuation; coordinate with #615 and add a Responses regression. A fresh original prompt can currently be reported as fully cached because the last continuation's cache count is clamped to its length.
  • Reconcile visible reasoning replay with the guide: removing only encrypted_content from an item that also has raw content and a summary currently rejects the nonempty summary. Full returned-item encrypted replay passes.
  • Qualify an isolated native run on this Responses branch, followed by a genuine model-generated Codex read/edit/verify loop before claiming that workflow.
  • Reduce repeated evidence/type-catalog material in the upstream diff while retaining the full public archive and representative regression fixtures.
  • Put the replay-key step before server startup in the quickstart and provide one complete matching client configuration.

Reviewed head: 46a44c51782eae4119b85b27c5b3639bc870e0a2 on CC-David-CC:work/responses-api. Its R4 implementation is 96092670da0dc3c1cfcce99bb90a3e6ca25ae1d9; the tip adds the checkpoint receipt.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/630 **Author:** [@CC-David-CC](https://github.com/CC-David-CC) **Created:** 10/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `work/responses-api` --- ### 📝 Commits (9) - [`0fc5140`](https://github.com/Niko1221/Strata/commit/0fc5140d03830036c26fee028127bdb8ce81bd53) responses R0: pin client capture and upstream baseline evidence - [`88a63bc`](https://github.com/Niko1221/Strata/commit/88a63bcb95bd2d4d08b1bbb170c395c00620f5cf) responses R1: add stateless request boundary and local assembler - [`53c4f9f`](https://github.com/Niko1221/Strata/commit/53c4f9f6d0e1c121a387a2c5f2b47ba91b058c2f) responses R2: stream typed events and verify cancellation cleanup - [`5cb5746`](https://github.com/Niko1221/Strata/commit/5cb57467d79fb30d3b53ff249fbf2baef1e3b5c5) Support client-owned functions and honest Responses reasoning - [`9609267`](https://github.com/Niko1221/Strata/commit/96092670da0dc3c1cfcce99bb90a3e6ca25ae1d9) Qualify the Responses client profile and freeze R4 acceptance - [`46a44c5`](https://github.com/Niko1221/Strata/commit/46a44c51782eae4119b85b27c5b3639bc870e0a2) Record the exact passing R4 checkpoint receipt - [`f262838`](https://github.com/Niko1221/Strata/commit/f26283816c294c7af8b640d2b39a0b6568127ce5) Preserve literal tool markup in Responses reasoning summaries - [`8258746`](https://github.com/Niko1221/Strata/commit/82587463b81c9787f69b72b5f73e008a983d18f9) Distinguish literal tool markers from function call preambles - [`116da0c`](https://github.com/Niko1221/Strata/commit/116da0cefd1e08701250e9b45551cd45f77756d5) Document parser fixes and Responses regression checkpoint ### 📊 Changes **159 files changed** (+30244 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `README.md` (+3 -0) ➕ `docs/RESPONSES.md` (+206 -0) ➕ `docs/responses-evidence/R0/REPORT.md` (+88 -0) ➕ `docs/responses-evidence/R0/baseline/serve-test_detok.txt` (+13 -0) ➕ `docs/responses-evidence/R0/baseline/serve-test_lifecycle.txt` (+25 -0) ➕ `docs/responses-evidence/R0/baseline/serve-test_mcp.txt` (+89 -0) ➕ `docs/responses-evidence/R0/baseline/serve-test_monitor.txt` (+30 -0) ➕ `docs/responses-evidence/R0/baseline/serve-test_security.txt` (+26 -0) ➕ `docs/responses-evidence/R0/baseline/serve-test_server.txt` (+311 -0) ➕ `docs/responses-evidence/R0/baseline/serve-test_structured.txt` (+37 -0) ➕ `docs/responses-evidence/R0/baseline/test-results.json` (+86 -0) ➕ `docs/responses-evidence/R0/capture-attempt-1.json` (+34 -0) ➕ `docs/responses-evidence/R0/client-profile.json` (+34 -0) ➕ `docs/responses-evidence/R0/codex-capture-output.txt` (+6 -0) ➕ `docs/responses-evidence/R0/codex-profile.toml` (+12 -0) ➕ `docs/responses-evidence/R0/handoff-checks.json` (+41 -0) ➕ `docs/responses-evidence/R0/handoff-pack.txt` (+1 -0) ➕ `docs/responses-evidence/R0/handoff-tests-utf8.txt` (+58 -0) ➕ `docs/responses-evidence/R0/handoff-tests.txt` (+78 -0) _...and 80 more files_ </details> ### 📄 Description Related to #451. Adds an experimental stateless `POST /v1/responses` adapter for clients such as Codex. Text, reasoning, function calls and client-owned tool results pass through the existing Strata service. One request-local assembler produces final JSON and typed SSE with stable item IDs, indexes and sequence numbers. This is a bounded compatibility profile. Unsupported behavior is rejected explicitly. This draft needs the accounting and replay-contract follow-ups below before it is ready to merge. ## Behavior and ownership - Calls `Service.run()` directly, consuming semantic parser events. Existing FIFO admission, model execution, authentication, CORS, cancellation and engine-output draining remain in use. - Supports content-bearing input history, per-request instructions, explicit `store:false`, non-strict functions including namespaces, matching `function_call_output` items, visible reasoning, separately generated summaries and authenticated Strata-issued replay tokens. - Keeps response state request-local. The client supplies history; no state is inferred from GPU cache. No new serving framework or native/MTP changes are included. - Includes a small existing `/load` and `/unload` fix: consume bounded request bodies before replying. The Windows connection-reset failure was also reproduced against the selected upstream base; the R4 report records it. ## Enablement Disabled by default. Install `requirements-responses.txt`, supply a stable `STRATA_RESPONSES_REPLAY_KEY` in the server environment, and start the existing configured server with `--experimental-responses` or top-level config `"experimental_responses": true`. Use the existing API-key configuration. Disabled startup imports no optional crypto dependency and leaves `/v1/responses` unavailable. Clients use the ordinary Responses endpoint with explicit `store:false`; no experimental request field is needed. The [guide](https://github.com/CC-David-CC/Strata-a5500/blob/46a44c51782eae4119b85b27c5b3639bc870e0a2/docs/RESPONSES.md) describes setup, continuation, the tested Codex profile and capability limits. ## Validation and its limits - Recorded R4 CPU/MockEngine regression checkpoint: 235 passed, five optional detokenizer skips. The final environment-key check passed all 44 Responses tests. [R4 report and commands](https://github.com/CC-David-CC/Strata-a5500/blob/46a44c51782eae4119b85b27c5b3639bc870e0a2/docs/responses-evidence/R4/REPORT.md). - Official `openai==3.23.0`: JSON, typed streaming and assembly, namespaced function/result replay, reasoning and authenticated replay. Process-restart checks verify replay with the same deployment key and no stored response files. - Codex CLI 0.160.0 performed a real local read/edit/verify loop over four requests with three successful tool results. **The model output in that protocol test was scripted MockEngine output.** [Client receipt](https://github.com/CC-David-CC/Strata-a5500/blob/46a44c51782eae4119b85b27c5b3639bc870e0a2/docs/responses-evidence/R4/codex/codex-task.json). - Additional native evidence exists on the GBNF follow-up: pinned local Codex received `Hello world` from a real Coder IQ1_M model on an RTX 4090 over LAN, including real reasoning and a generated summary. It did not call tools. This validates the combined follow-up configuration, not an isolated native test of this PR. [Native receipt](https://github.com/CC-David-CC/Strata-a5500/blob/c91260ccd3a929ae51696c9dff1f972d6d56adfe/docs/responses-evidence/native-codex/REPORT.md). The source audit verifies no native/build changes against upstream `99f3dbd0b21d1401b3769e0c0d963913607f380b`. These results cover the recorded client/profile and do not establish compatibility with every Codex version or a complete native coding workflow. ## Excluded capabilities No retained-response CRUD, `previous_response_id`, background execution/cancel endpoint, compaction, media, hosted tools or WebSockets. Strict/omitted-strict functions, JSON Schema/JSON-object output and custom/Lark tools are rejected. Raw GBNF belongs to a separate native contribution and is not needed to use this adapter. Reasoning summaries require another generation pass and count toward the output allowance. ## Before merge - [ ] Correct original-prompt cache accounting when the shared service wraps a reasoning-budget continuation; coordinate with #615 and add a Responses regression. A fresh original prompt can currently be reported as fully cached because the last continuation's cache count is clamped to its length. - [ ] Reconcile visible reasoning replay with the guide: removing only `encrypted_content` from an item that also has raw content and a summary currently rejects the nonempty summary. Full returned-item encrypted replay passes. - [ ] Qualify an isolated native run on this Responses branch, followed by a genuine model-generated Codex read/edit/verify loop before claiming that workflow. - [ ] Reduce repeated evidence/type-catalog material in the upstream diff while retaining the full public archive and representative regression fixtures. - [ ] Put the replay-key step before server startup in the quickstart and provide one complete matching client configuration. Reviewed head: `46a44c51782eae4119b85b27c5b3639bc870e0a2` on `CC-David-CC:work/responses-api`. Its R4 implementation is `96092670da0dc3c1cfcce99bb90a3e6ca25ae1d9`; the tip adds the checkpoint receipt. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:02:43 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2731
No description provided.