fix(app): performance stage switches survive failures, reconnects and late signals
- the normal stage reads other programs' memory afresh (the card after the LLM stopped, less the STT worker's model) and keeps it; the game stage counts from the latest normal reading, so the game is not counted against its own reserve - a restart that fails brings back the stage that ran before and tells the brain ready; the failed stage is tried again after 60 s, three times at most; when nothing comes back the brain is told paused so requests fail at once - the worker client keeps the latest llm state and sends it first on every connection - switches are numbered: llm switching carries an id, llm_idle names it, and a late idle of an earlier switch no longer lets a new one through - a request that waited 180 s for a switch fails without calling the brain - the dashboard shows the stage that runs also on a fallback placement without experts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -354,8 +354,8 @@ The app restarts the LLM with another placement when a game starts or ends (app/
|
||||
"Performance stages"). It tells the worker first and waits for the brain to be idle:
|
||||
|
||||
```
|
||||
-> {"type": "llm", "state": "switching", "notice": "잠깐만요, 게임 모드로 바꾸는 중이에요"} // notice optional
|
||||
<- {"type": "llm_idle"} // nothing that uses the LLM runs any more
|
||||
-> {"type": "llm", "state": "switching", "id": 7, "notice": "잠깐만요, 게임 모드로 바꾸는 중이에요"} // id, notice optional
|
||||
<- {"type": "llm_idle", "id": 7} // nothing that uses the LLM runs any more (id: the switch's, when it had one)
|
||||
-> {"type": "llm", "state": "ready"} // the LLM answers again
|
||||
-> {"type": "llm", "state": "paused"} // the LLM is stopped (a game runs)
|
||||
```
|
||||
@@ -366,10 +366,12 @@ The app restarts the LLM with another placement when a game starts or ends (app/
|
||||
- The first spoken `reply` that waits during one switch hears the notice under its own id (its
|
||||
answer follows in the same speech when ready); later ones wait without it. A notice ends with a
|
||||
newline, so it is spoken at once and never joined to the answer. A request waits at most 180 s,
|
||||
then goes on (its LLM call fails on its own if the LLM is still away).
|
||||
then fails without calling the brain (the LLM may still be away, or a measuring server stand in).
|
||||
- On `paused` brain work answers nothing at once (`reply_text` `failed`, judgements failed) until
|
||||
`ready`; what waited for a switch stops waiting the same way.
|
||||
- Any other `state`, or a notice that is not a string, is `bad_message`.
|
||||
- Any other `state`, a notice that is not a string or an id that is not an integer is `bad_message`.
|
||||
- The app sends its latest `llm` message again first on every connection, so a worker that missed
|
||||
one (a dropped connection, a restarted worker) catches up.
|
||||
|
||||
### Errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user