Title: muse-proxy: signal-killed runs report 'muse exec exited with code null', and #673's empty-stderr terminal-state fallback is untested · Issue #674 · developing-today/code · GitHub
Open Graph Title: muse-proxy: signal-killed runs report 'muse exec exited with code null', and #673's empty-stderr terminal-state fallback is untested · Issue #674 · developing-today/code
X Title: muse-proxy: signal-killed runs report 'muse exec exited with code null', and #673's empty-stderr terminal-state fallback is untested · Issue #674 · developing-today/code
Description: Finding PR #673 (fixing #672) reworked bin/muse-proxy.mjs's failure handling so failure is judged by the authoritative terminal state, and — when stderr is empty — the error detail names that terminal state instead of the misleading muse...
Open Graph Description: Finding PR #673 (fixing #672) reworked bin/muse-proxy.mjs's failure handling so failure is judged by the authoritative terminal state, and — when stderr is empty — the error detail names that termi...
X Description: Finding PR #673 (fixing #672) reworked bin/muse-proxy.mjs's failure handling so failure is judged by the authoritative terminal state, and — when stderr is empty — the error detail names that t...
Opengraph URL: https://github.com/developing-today/code/issues/674
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"muse-proxy: signal-killed runs report 'muse exec exited with code null', and #673's empty-stderr terminal-state fallback is untested","articleBody":"## Finding\n\nPR #673 (fixing #672) reworked `bin/muse-proxy.mjs`'s failure handling so failure is judged by the authoritative terminal state, and — when stderr is empty — the error detail names that terminal state instead of the misleading `muse exec exited with code 0`. The fallback expression it left behind (current `main`, `bin/muse-proxy.mjs:404-409`) has two remaining gaps in the same spot:\n\n```js\nconst failed = terminalState ? terminalState !== 'completed' : code !== 0;\nif (failed) {\n const stderrLine = stderrTail.trim().split('\\n').pop();\n const fallback = terminalState && terminalState !== 'completed'\n ? `muse run terminated with state '${terminalState}'`\n : `muse exec exited with code ${code}`;\n```\n\n### 1. Signal-killed runs report `muse exec exited with code null`\n\nThe close handler is `child.on('close', (code, signal) => …)` (line 367), but `signal` is never used. When the child dies by signal (OOM `SIGKILL`, `SIGTERM`, …), Node reports `code === null`, the run correctly counts as failed (`code !== 0`), but with empty stderr the detail becomes the literal string `muse exec exited with code null` — the same class of misleading detail #673 set out to eliminate for the terminal-state case.\n\nReproduced on current main (`4a91edc3`, merge of #673) with a stub `muse` that kills itself and prints nothing:\n\n```sh\n#!/bin/sh\nkill -9 $$\n```\n\n- Non-stream: `500 {\"error\":{\"message\":\"Muse execution failed: muse exec exited with code null\"}}`\n- Stream: SSE error event with the same `code null` message, then `data: [DONE]`\n\n### 2. The empty-stderr terminal-state fallback added by #673 has no test coverage\n\nBoth failure stubs added by #671/#673 emit a stderr line (`stub muse: run failed midway`, `stub muse: crashed midway`), and the #672 test only asserts `/Muse execution failed: stub muse:/` — so the `stderrLine` is always what satisfies the assertion and the new fallback string is never exercised.\n\nVerified by ablation in a scratch copy: reverting **only** the fallback-detail lines to the pre-#673 form (`stderrTail… || \\`muse exec exited with code ${code}\\``), while keeping #673's failure predicate, still passes the full suite 4/4 (`node --test bin/muse-proxy.test.mjs`). The behaviour itself works today — a stub emitting `run.terminal.failed` with **no** stderr returns `Muse execution failed: muse run terminated with state 'failed'` in both modes — but nothing pins it, so a future refactor can silently regress it back to `exited with code 0`.\n\n## Evidence\n\n- PR #673: https://github.com/developing-today/code/pull/673 (commit `df1dd2502d98b2a7bf435e7a2789f49965354dbe`, merged in `4a91edc359063734da7d0b8a8dedbd2d49591216`), diff hunk changing the failure predicate and detail fallback in `bin/muse-proxy.mjs`.\n- Current main: `bin/muse-proxy.mjs:367` (close handler signature `(code, signal)`), `:404-409` (predicate + fallback quoted above).\n- Tests: `bin/muse-proxy.test.mjs` — `FAILPARTIAL`/`CRASHPARTIAL` stubs (lines 32-43) both write to stderr; the #672 test's error assertions (lines 175, 188) match only the stderr text.\n- Live repro of both the `code null` message and the working-but-untested terminal-state message, run against current main as described above.\n\n## Why it matters\n\nThis proxy is the OpenAI-compatible surface other tools drive `muse exec` through; when a run dies, the error detail is often the *only* diagnostic a client (or a human reading its logs) gets. `exited with code null` sends debugging in the wrong direction (a signal kill — e.g. OOM — looks like a corrupt message), and the one fallback #673 deliberately improved can regress unnoticed because no test reaches it.\n\n## Acceptance criteria\n\n- [ ] A run terminated by a signal with empty stderr and no terminal event produces an error detail that names the signal (e.g. `muse exec terminated by signal SIGKILL`) instead of `exited with code null`, in both stream (SSE error frame + `[DONE]`) and non-stream (500) modes.\n- [ ] A stub mode that emits a non-`completed` terminal event with **empty** stderr is added to `bin/muse-proxy.test.mjs`, asserting the detail names the terminal state (e.g. `terminated with state 'failed'`) in both modes.\n- [ ] A stub mode whose child dies by signal (e.g. `kill -9 $$`) with empty stderr is added, asserting the signal-naming detail in both modes.\n- [ ] `node --test bin/muse-proxy.test.mjs` passes, and ablating either fallback branch makes exactly the new assertions fail.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T17:41:50Z","url":"https://github.com/developing-today/code/issues/674"}
| 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:3ebc15b6-459f-e92f-8648-24f3b5db7b95 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8EE8:29C715:AE60CC:E1ED45:6B0638A5 |
| html-safe-nonce | 97a22d8c17f6f4b3bff5873540e1c8f704ae3ef6d803a0654241b32f3406f313 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RUU4OjI5QzcxNTpBRTYwQ0M6RTFFRDQ1OjZCMDYzOEE1IiwidmlzaXRvcl9pZCI6Ijc0NzMxMzA2NzYwNjY1OTcwMjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 80afd534a9e656a5bc29f19c23896754f644a811041d7ad8d12ceaa49de15372 |
| hovercard-subject-tag | issue:6002658338 |
| 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/674/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4d0f1da5ef3d2257cca9e8653474ebeb7522f29ea36876a2ec3bd5376e1a4a27/developing-today/code/issues/674 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4d0f1da5ef3d2257cca9e8653474ebeb7522f29ea36876a2ec3bd5376e1a4a27/developing-today/code/issues/674 |
| og:image:alt | Finding PR #673 (fixing #672) reworked bin/muse-proxy.mjs's failure handling so failure is judged by the authoritative terminal state, and — when stderr is empty — the error detail names that termi... |
| 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 | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| 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 | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| 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