mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #576] Windows: stopping the server with Ctrl+Break loses the conversation that MAYA_GLM_SLOT_KEEP should keep #238
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#238
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 @pschaub on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/576
The problem: With
MAYA_GLM_SLOT_KEEP=1the conversation in the model should be kept when the engine ends (docs/SETTINGS.md). On Windows, when I stop the server with Ctrl+Break in its console, the conversations set aside earlier are kept, but the one in the model is lost. After the restart it is read again from token 0.The idea: On Windows the engine ignores Ctrl+C and Ctrl+Break in serve mode, as it already ignores SIGINT and SIGTERM on Linux. The server still stops on them and ends the engine with QUIT, and the engine writes the conversation before it ends.
What it brings: After a restart the last conversation goes on where it stopped instead of being read again. In my test its next turn took 2.0 s instead of 7.8 s.
Who it helps: Everyone on Windows who uses
MAYA_GLM_SLOT_KEEP=1and stops the server from its console. On Linux the engine already ignores these signals.Why it happens: Windows sends a console's Ctrl+C and Ctrl+Break to every process in it, the engine included. The server handles both and then ends the engine with QUIT, so that the engine can write the conversation first:
github.com/mw00/project-maya@88a746c9f9/serve/server.py (L4699-L4717)By then the engine has already ended on the event itself. On Linux it ignores these signals in serve mode for this reason. On Windows that block is compiled out and nothing takes its place (src/program/generate.cpp#L1036-L1046):
The DeepSeek engine has the same block:
github.com/mw00/project-maya@88a746c9f9/src/ds4/ds4_main.cpp (L915-L922)The fix adds an
#elseto both blocks that ignores SIGINT and SIGBREAK, which the C runtime on Windows raises for Ctrl+C and Ctrl+Break.Measurements: Maya v1.1.27 built from source,
MAYA_GLM_SLOT_KEEP=1. Two conversations of 6,165 tokens, X first, then Y, so Y is in the model at the stop. Then Ctrl+Break to the server (sent as CTRL_BREAK_EVENT to its process group, which the engine is in too), a new start, and a short follow-up to each. 2 runs per build, alternating:With the fix the engine logs
glm slots: saved a 6164-token conversation on shutdown (0.23 GB in 0.1 s)at the stop; without it there is no such line. The build without the fix also had an unrelated change with its switch off that touches none of these files. The signal blocks and the server's stop path are the same in v1.1.33.I only tested Ctrl+Break with the GLM engine. Ctrl+C takes the same path (SIGINT), but I did not test it. The DeepSeek engine builds with the change, but I have not run it. A PR with the fix follows.
My setup: Maya v1.1.27 built from source, MSVC 19.44, CUDA 13.4, RTX 5090 32 GB, 64 GB DDR5, Ryzen 9 9950X3D2, Windows 11, Maya-S-v2 IQ2_XXS