mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4409] [Engine] scope: move a conversation between Strata servers (save by client session, import into the conversation cache, incremental saves) #1965
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#1965
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?
Originally created by @janit on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4409
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
We run several Strata servers behind one router. The router sends a client session to another server when its own is
full, restarting or slower than a free one. The new server has none of the conversation's K/V, so its first turn reads
the whole prompt again: 41 s for a 50k-token conversation on one RTX A4000, 24.5 s for 82.9k tokens on an RTX 5090.
Long coding-agent sessions are exactly the ones that move, and they pay the most.
Session files already make this possible in principle: a 50k file saved by one process and restored in another
continued with the same output. The current API stops short in four ways:
--batcha slot changes hands between requests, so a router cannot name theconversation it wants. Save and restore also refuse
--batchoutright.nothing, so a caller that imported a conversation cannot tell whether it is still there.
Proposed behavior
All opt-in, all behind
--slot-save-path(no session is remembered and every endpoint answers 501 without it):POST /slots/session?action=save {session, filename[, base]}: save the conversation a client session(
X-Session-Affinity, elseX-Session-Id) last continued, from a batch slot, the live session or the conversationcache. The engine checks a hash of the conversation's first ids before writing (
SAVEC), so a slot that changed handsis never saved under the wrong name. With
base(an earlier save's id) it writes a delta file (STRSDLT v1) instead.POST /slots/0?action=import {filename}: read and check a session file as restore does, then park it in theconversation cache (
IMPORT). The live session and the batch slots are untouched; a matching prompt resumes from itthrough the existing cache path.
POST /slots/session?action=held {session}: how many tokens of that conversation the engine still holds (HELD),read only.
STRSESS is unchanged. The existing
/slots/0?action=save|restorekeep their current behavior, including refusing--batch.The session writer also gets two changes that write the same bytes faster: the deepest checkpoint by reference instead of
copied, and full blocks written on a thread (0.80 to 0.56 s at 50k on an A4000).
Tradeoffs
--slot-save-pathis set.--layer-split,--peer-deviceand pictures stay refused, as for session files today.Evidence so far
On the branch below (v0.2.7 main plus this change), one RTX A4000, Qwen3.8-Flash-Next IQ3_XXS:
--slot-save-path, greedy answers to the same prompts were byte-identical to v0.2.7 across four freshprocesses (two each).
0.30 s. Imported into a fresh process in 0.99 s, the next turn took 1.43 s (49,308 tokens reused) against 42.7 s cold.
base + delta rebuilt the engine's own full save byte for byte.
metal-build.ymlworkflow) and HIP RDNA (gfx1100, gfx1201, TheRockwheels). For gfx906 the changed files compile, but the engine does not link because of
src/core/dflash2.cpp,which fails the same way on main.
Earlier versions of the same change ran on two RTX 5090 hosts behind a router: a 16-session coding-agent workload
resumed 93.8-96.8% of its host switches warm. Write-up: https://viiwork.pulu.app/blog/kv-share-two-5090-hosts/
(viiwork is the router).
The change is about 1,700 lines, including 690 lines of tests and 130 of docs, on v0.2.7 main:
https://github.com/janit/Strata/tree/kv-export-upstream
I have no RDNA or Intel Arc hardware and cannot get any, so those would need a tester from the community; I may be
able to test gfx906 later.
Questions for the maintainers
held? Each depends on the one before.SAVEC,SAVEX,IMPORT,HELD) acceptable, or would you ratherthey followed another convention?
What do you do today instead?
A cold prefill on every move, or not moving sessions at all and queueing behind a busy server.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.