fix(deepseek): restart a server whose token exchange failed

Reuse returned the running server whenever it answered HTTP and matched
the authority, including one whose launch token could not be exchanged
for a cookie. That server answered 401 forever, so the restart the
warning asks for could never happen. Track the failed exchange and skip
reuse, which makes the next start request stop and respawn it.
This commit is contained in:
ArizeSky committed 2026-11-16 16:09:16 +08:00
1 parent 4ce9abde7d
commit b1bcd1e3af
4 files changed
+103 -14

No files matched your search

+4 -1
View File
@@ -301,7 +301,10 @@ elsewhere. The reader scans every `dsh web:` line (dsh prints diagnostics such a
`dsh web: loading profiles` under the same prefix before the banner) and only
complete lines, so a banner split across two output chunks is waited for rather
than parsed truncated. A dsh without the gate prints a token-less banner and
keeps working unchanged.
keeps working unchanged. If a token is printed but the exchange still fails, the
server keeps running (its page serves, just 401) and is marked unusable for
reuse: the next start request stops and respawns it, which is the "restart `dsh
web`" the warning asks the user to perform.
The cookie is also bound to a person, not to a URL. `managed` is accepted from the
client on `POST/PATCH /api/webviews` and `GET /api/deepseek/web` publishes the live