mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4878] [GUI] Keep quiet desktop chat streams alive #5227
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#5227
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/4878
Author: @rinesh
Created: 11/1/2026
Status: 🔄 Open
Base:
main← Head:fix/desktop-chat-stream-heartbeat📝 Commits (1)
dafdbcb[GUI] Keep quiet desktop chat streams alive📊 Changes
2 files changed (+65 additions, -2 deletions)
View changed files
📝
apps/host/server/index.mjs(+9 -0)📝
apps/host/tests/agent-host.test.mjs(+56 -2)📄 Description
Problem and result
The Mac desktop app can show “Load failed” after a chat stream has been quiet for 60 seconds. The agent continues in the background, so a later message can then fail with “This chat is still working. Stop it or wait for it to finish.” Periodic NDJSON keep-alives now keep the connection open during prompt processing, tools, and approval waits.
Reproduced locally on packaged Strata 0.2.9, macOS 15.6.1, Apple M2 Max / 32 GB unified memory, using an OpenAI Chat Completions server on another Mac and
qwen3.8-flash-next-huihui-abliterated-gyro-s. A follow-up sent at 11:09:13 failed at 11:10:13 with WebKitNSURLErrorDomain Code=-1001/isTimeout=1; the server remained healthy. Applying this same nine-line change to the installed app allowed the same conversation to complete successfully.Related discussion
Searched open and closed issues/PRs for the exact errors, WebKit, heartbeat, and keep-alive. No matching desktop-host fix was found, and
mainatc62d5e3a15b40ea51c96aae9e8d36928965f53abstill lacked this heartbeat. Related engine proposals #4196 and #4340 concernserve/server.pyand the model API; this change covers the app host's NDJSON connection.Approach
{"type":"beat"}frame every 15 seconds on the shared/api/chat/streamand/api/plan/start-goalresponse path. The host already uses this frame for Time-skip streams, and the chat consumer ignores it.finishandclose.Validation
Tested commit:
dafdbcb8957f168073e45cdd9835b1c13cf14d4a, based on themainrevision above. Node v26.13.0 on macOS 15.6.1; real packaged Harness 0.2.1-alpha.3 with a loopback scripted model. No model weights were downloaded for the tests.Passed:
From
apps/host:The selected suite passed 44 tests, 0 failed, 0 skipped.
git diff --checkalso passed. The live Mac desktop reproduction succeeded with the identical server patch; the agent subsequently reported zero active turns and zero pending approvals.Failed:
main:a quiet model must not leave the desktop connection idle.esbuildin the fresh checkout. After installing the locked dependencies withnpm ci --ignore-scripts --no-audit --no-fund --cache ../../../npm-cache, the complete selected suite passed. No failures remain in that final run.Not run:
Limits
This prevents quiet-stream timeouts. It does not reconnect an already disconnected page or change the existing background-agent lifecycle; an already stranded turn may still need Stop. The approval regression requires a built Harness and explicitly skips when one is unavailable.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.