mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1032] [CLOSED] serve: add opt-in bounded Responses history and continuation #2979
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2979
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1032
Author: @mdwsk88
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:codex/responses-state📝 Commits (10+)
fa16567setup: an earlier config that does not parse is skipped, not a crash; configs are written atomically (#459)749d957setup (--backend hip): a system ROCm without the HIP development files falls back to the wheels (#446)5a30024calibrate: the engine's arguments come from the server's engine_args; a failed tuning says why (#447)9f60d13serve, setup: name the small split card that caps the prompt chunk; setup recommends the big card alone (#448)eb8da1d/metrics: each request's speculative draft counts, and their sums in the totals (#457)6a09387setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)d6a91e2docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)d8d4ad3Merge branch 'f-135-eng' into rel-0.1.357b600d5Merge branch 'f-135-small' into rel-0.1.35d9ab843Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it📊 Changes
8 files changed (+579 additions, -26 deletions)
View changed files
📝
docs/AI_SETUP.md(+2 -1)📝
docs/DETAILS.md(+39 -5)➕
serve/response_store.py(+112 -0)📝
serve/responses.py(+19 -10)📝
serve/runconfig.py(+2 -0)📝
serve/server.py(+70 -10)➕
serve/test_response_store.py(+326 -0)📝
serve/test_runconfig.py(+9 -0)📄 Description
Clients written against OpenAI's Responses API continue a conversation with
previous_response_idand read ordelete results by ID (
responses.retrieve,responses.delete). On Strata today these requests are refused(
previous_response_idis a 400, the ID routes are 404), so such a client has to be rewritten to resend the wholeconversation. I ran into this running Strata on Windows.
This adds optional, bounded storage to the existing Responses adapter: create a response, send only the next input
with
previous_response_id, then retrieve or delete the stored result.Off by default, and off means unchanged. Without
--responses-store-mib(or"responses_store_mib"in theconfig), status codes and response fields are the same as on main:
storeis not looked at (the answer saysstore: false) andprevious_response_idis refused as before (test_disabled_keeps_the_stateless_behavior).When on (
--responses-store-mib 64, the config key, or the web page's Model settings):previous_response_idcontinues a stored response through the existing generation path, including function-calloutputs and streaming. Top-level
instructions, tools and generation settings are not inherited, as in OpenAI's API.GET /v1/responses/{id}andDELETE /v1/responses/{id}; other routes under it (input_items,cancel) answer"not supported".
store: false. Completed and incomplete responses are saved before their finalevent; failed, cancelled and in-progress ones are not.
lifetime (
responses_store_ttl_s), oldest evicted first. A record that cannot fit is HTTP 413 (response.failedonce streaming has started); a replay that alone exceeds the budget is refused before the model runs.
need the JSON content type a POST does).
The conversation cache. A continuation reads token for token the same prompt as a client that sends the whole
conversation, and the previous turn's prompt is its start
(
test_a_continuation_reads_the_same_prompt_as_the_whole_history), so the cache is reused as it is for Codex.Process memory only, lost on restart, and separate from the engine's KV cache. Builds on the stateless
implementation from #451; the inference engine is unchanged.
Measured on Windows, RX 7900 XT (HIP), Qwen3.8-Flash-Next IQ2_XS, 32K context, 4 MiB store, with the first
revision of this commit: the OpenAI SDK flow create → continue → retrieve → stream → delete → 404 passed, as did
continuing a child after its parent was deleted, and
store: false. A run of this revision, with the continuation'scached_tokens, follows.Tests: 292 run, 0 failed, 7 skipped (environment-dependent; macOS, mock engine). 24 are new: CRUD,
continuation, the replayed prompt, branching, tool results, expiry, byte/count limits, concurrency, validation,
failures, auth/CORS, the unchanged default, the Settings key and an optional OpenAI SDK round trip (
openai==3.24.0).This is one self-contained commit on current main. If you would rather land your own version, cherry-picking it
keeps the tests and docs together.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.