mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #637] [CLOSED] serve: retry an engine start that fails, and keep the last known context after a failed restart #2734
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#2734
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/637
Author: @JeanP00l
Created: 10/3/2026
Status: ❌ Closed
Base:
main← Head:pr-serve-restart📝 Commits (1)
dc15468serve: retry an engine start that fails, and keep the last known context after a failed restart📊 Changes
2 files changed (+96 additions, -12 deletions)
View changed files
📝
serve/server.py(+41 -12)📝
serve/test_server.py(+55 -0)📄 Description
What
After the engine was ended mid-request (seen in long Claude Code sessions, many turns at ~20K tokens, on 2x 16 GB GPUs), the new engine could exit before
READY: it ran out of VRAM while the old one's was still being handed back.restart()raised,max_contextstayed 0, and from then on every request failed with400 ... exceeds the context (0)until the server was restarted by hand.Since 0.1.38,
close()already ends the old process and waits for it. This PR adds only what is still missing.Change (serve/server.py)
READYis tried again, 3 times,RESTART_RETRY_S(15 s) apart.startingis set meanwhile, so a request gets the 503 "starting" of #344.known_ctxkeeps the last context the engine reported. After a restart that failed for good, a request is checked against it and reachesrun(), which starts the engine again, instead of getting a 400 about context 0.Tests
Two new tests in
RestartWindow, both fail without the change:max_context0, not starting,known_ctx4096) gets 200, not a 400.python -m unittest serve.test_server: 120 tests OK (Linux, Python 3.12).🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.