Title: muse-proxy: exec fallback path has no turn deadline — a hung muse exec child hangs the request forever · Issue #2159 · developing-today/code · GitHub
Open Graph Title: muse-proxy: exec fallback path has no turn deadline — a hung muse exec child hangs the request forever · Issue #2159 · developing-today/code
X Title: muse-proxy: exec fallback path has no turn deadline — a hung muse exec child hangs the request forever · Issue #2159 · developing-today/code
Description: Problem bin/muse-proxy.mjs's exec (cold) path has no turn deadline. When the warm MSP path is disabled (MUSE_PROXY_WARM=0) or a request falls back to exec, the handler spawns muse exec (bin/muse-proxy.mjs:979) and the HTTP response is co...
Open Graph Description: Problem bin/muse-proxy.mjs's exec (cold) path has no turn deadline. When the warm MSP path is disabled (MUSE_PROXY_WARM=0) or a request falls back to exec, the handler spawns muse exec (bin/muse-pr...
X Description: Problem bin/muse-proxy.mjs's exec (cold) path has no turn deadline. When the warm MSP path is disabled (MUSE_PROXY_WARM=0) or a request falls back to exec, the handler spawns muse exec (bin/mus...
Opengraph URL: https://github.com/developing-today/code/issues/2159
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"muse-proxy: exec fallback path has no turn deadline — a hung muse exec child hangs the request forever","articleBody":"## Problem\n\n`bin/muse-proxy.mjs`'s exec (cold) path has no turn deadline. When the warm MSP path is disabled (`MUSE_PROXY_WARM=0`) or a request falls back to exec, the handler spawns `muse exec` (`bin/muse-proxy.mjs:979`) and the HTTP response is completed only from the child's `close` handler (`:1083`). There is no timer on this path: the only kill is on client disconnect (`res.on('close')` → `child.kill('SIGTERM')`, `:992-996`). If the spawned `muse exec` child hangs — alive but never emitting a terminal event (upstream stall, a CLI waiting on input the proxy never sends, a wedged run) — and the client is a patient programmatic caller (an OpenCode session, a queue worker), the request hangs forever and the child accumulates.\n\nEvery sibling path is bounded, including in this same file:\n\n- The warm path in this file: `WARM_TURN_TIMEOUT_MS = 300 * 1000` (`:300`), applied per turn (`:585-587`); MSP `rpc()` defaults to a 30s timeout (`:513-519`); even the `--help` capability probe kills its child after 10s (`:216-219`).\n- `bin/claude-code-proxy.mjs`: `TURN_TIMEOUT_MS = 300 * 1000` (`:55`) on its spawned turns, with SIGKILL escalation (`:480`).\n- `bin/codex-proxy.mjs`'s app-server path: 10s connect / 30s RPC timeouts (its exec path has the same defect as this one and is filed separately this run).\n\nThe exec path is the fallback taken exactly when the bounded warm path is unavailable or has failed — the moment a hang is most likely — and it is the one path with no bound.\n\n## Evidence (verified this run, main `b2b885b9`)\n\nSandbox probe with a fake `muse` binary (`$HOME/.local/bin/muse` under a scratch HOME; the fake answers `--help` probes with a flags line and sleeps 60s for any other invocation), `MUSE_PROXY_WARM=0`:\n\n- Proxy log: `CLI probe: exec advertises 6 flags...` then `Spawning: .../muse exec --json --prompt-file ... --model muse-spark-1.3 --reasoning-effort low --user-input-auto-resolve --approval-mode never` — the request reached the exec spawn at `:979`.\n- `curl -X POST /v1/chat/completions` (non-streaming): **no response after 8s** (curl killed by `timeout 8`, exit 124, 0 response bytes) while the fake child (`sleep 60`) was still running. Nothing in the proxy would have ended the request before the child's own exit — and a truly hung child never exits.\n\nDedup: `gh` searches for `muse-proxy timeout` and `muse-proxy hang` (open + closed) return no covering issue. Adjacent but distinct: #2097/#2100/#2102 are the same no-timeout class in design-code-proxy, clef-proxy, and antigravity-ls-proxy (HTTP fetch / RPC paths in other files); the codex-proxy exec path is filed separately this run.\n\n## Why it matters\n\nThis proxy is the only door from OpenCode sessions into the Meta pool (see the pool map in `~/hatch-personal/AGENTS.md`), so a wedged exec turn stalls the session routed through it with no error, no log line, and no recovery short of the client dying — at which point the accumulated child is killed only as a side effect of the disconnect. A bounded fallback would surface the same stall as a prompt, actionable error, consistent with how the warm path already behaves at 300s.\n\n## Acceptance criteria\n\n- [ ] A `muse exec` turn that exceeds a named deadline (consistent with the house convention — this file's own `WARM_TURN_TIMEOUT_MS` 300s, or a strictly parsed `MUSE_PROXY_*` env override) is terminated (SIGTERM, then SIGKILL after a short grace) and the request settles with the existing error-response shape (including the SSE error framing for streaming requests, #670).\n- [ ] The partially accumulated content / terminal-state reconciliation on `close` (#484/#672) still runs for a deadline-killed child, or the deadline path produces an equivalent explicit failure — never a silent successful `stop`.\n- [ ] The existing client-disconnect kill (`:992-996`) keeps working and races safely with the deadline kill.\n- [ ] Regression tests in `bin/muse-proxy.test.mjs` style: a fake child that never exits is killed at the deadline and the request errors; a fake child that completes normally is unaffected; the warm path is unchanged.\n- [ ] Prompt-file cleanup (`fs.unlinkSync(promptFile)`) happens on the deadline path as it does on `close`.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-29T06:51:09Z","url":"https://github.com/developing-today/code/issues/2159"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eaa15a9a-898d-c863-df13-52de5c02c9d7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DBDC:3AC956:C2B83D:FCB7A0:6B063F57 |
| html-safe-nonce | 921558b8f79895b966b35d317d2ec6911a3c42f06e44ab6d8502d522d63ec9e3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkRDOjNBQzk1NjpDMkI4M0Q6RkNCN0EwOjZCMDYzRjU3IiwidmlzaXRvcl9pZCI6IjU4NDg0ODE1NzAzMzE0NDMwMzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 59fa5edc39678f3e0a0cb465638623f769233ec702f2316309ac3de136fb7809 |
| hovercard-subject-tag | issue:6094554571 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/2159/issue_layout |
| twitter:image | https://opengraph.githubassets.com/223d21eecad4c2c49b0b6a95541206f0da78083dbee9362fa50a5404ff9a131b/developing-today/code/issues/2159 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/223d21eecad4c2c49b0b6a95541206f0da78083dbee9362fa50a5404ff9a131b/developing-today/code/issues/2159 |
| og:image:alt | Problem bin/muse-proxy.mjs's exec (cold) path has no turn deadline. When the warm MSP path is disabled (MUSE_PROXY_WARM=0) or a request falls back to exec, the handler spawns muse exec (bin/muse-pr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width