Summary
dev_rebuild_and_restart hardcodes a 120 s build timeout. A cold-cache npm run docker-build routinely exceeds that (the image is ~1.5 GB), and when the timeout trips the proxy reports Build failed: followed by a truncated tail of the Docker log — even though the build itself is fine. Re-running npm run docker-build by hand immediately afterwards succeeds and produces the image.
So the tool reports a successful build as a failure, and the accompanying output is a mid-RUN Dockerfile step rather than any diagnosis.
Current behavior
// tools/dev-proxy/dev-proxy.mjs:266
result = execSync(BUILD_CMD, {
cwd: PROJECT_ROOT,
encoding: 'utf-8',
stdio: ['ignore', 'pipe', 'pipe'],
timeout: 120000, // hardcoded
env: { ...process.env },
});
} catch (err) {
const output = [err.stdout, err.stderr].filter(Boolean).join('\n') || err.message || String(err);
throw new Error(`Build failed: ${sanitizeStderrTail(output, { maxLines: 20, maxChars: 2000 })}`);
}
execSync surfaces a timeout kill as a thrown error just like a non-zero exit, and the catch treats both identically. err.killed / err.signal === 'SIGTERM' are available and unused.
Observed
dev_rebuild_and_restart (mcp-debugger-docker)
→ { "success": false,
"error": "Build failed: …cp -r /app/packages/adapter-rust/dist
/app/node_modules/@debugmcp/adapter-rust/ (last 20 of 1454 lines)" }
$ npm run docker-build # same command, run directly
… #69 naming to docker.io/library/mcp-debugger:local done
$ echo $?
0
Note the 1454-line build log truncated to its last 20 lines — for a timeout that tail is always an arbitrary mid-build step, never the reason.
Requests
- Make the timeout configurable, alongside the other knobs the proxy already exposes as env vars (
DEV_PROXY_PORT, DEV_PROXY_BUILD_CMD, DEV_PROXY_ROOT, DEV_PROXY_BACKEND_TRANSPORT) — e.g. DEV_PROXY_BUILD_TIMEOUT_MS. A docker-group proxy could then be configured with a realistic ceiling.
- Raise the default, or make it depend on the configured
BUILD_CMD. 120 s is comfortable for npm run build but not for an image build.
- Distinguish a timeout from a build failure. On
err.killed/SIGTERM, say so — "Build timed out after 120000 ms (raise DEV_PROXY_BUILD_TIMEOUT_MS); the build may still have succeeded, re-run manually to confirm" — instead of Build failed:. This is the part that actually costs time: the message sends you looking for a build regression that isn't there.
Impact
Dev tooling only (tools/dev-proxy/), no effect on the shipped server. Worth fixing because the docker group is unusable through dev_rebuild_and_restart on a cold cache, and the misreport is convincing enough to derail a debugging session — it did during a /testdebugger sweep, where the docker group had to be rebuilt out-of-band and restarted with dev_restart_debugger.
Summary
dev_rebuild_and_restarthardcodes a 120 s build timeout. A cold-cachenpm run docker-buildroutinely exceeds that (the image is ~1.5 GB), and when the timeout trips the proxy reportsBuild failed:followed by a truncated tail of the Docker log — even though the build itself is fine. Re-runningnpm run docker-buildby hand immediately afterwards succeeds and produces the image.So the tool reports a successful build as a failure, and the accompanying output is a mid-
RUNDockerfile step rather than any diagnosis.Current behavior
execSyncsurfaces a timeout kill as a thrown error just like a non-zero exit, and thecatchtreats both identically.err.killed/err.signal === 'SIGTERM'are available and unused.Observed
Note the 1454-line build log truncated to its last 20 lines — for a timeout that tail is always an arbitrary mid-build step, never the reason.
Requests
DEV_PROXY_PORT,DEV_PROXY_BUILD_CMD,DEV_PROXY_ROOT,DEV_PROXY_BACKEND_TRANSPORT) — e.g.DEV_PROXY_BUILD_TIMEOUT_MS. A docker-group proxy could then be configured with a realistic ceiling.BUILD_CMD. 120 s is comfortable fornpm run buildbut not for an image build.err.killed/SIGTERM, say so — "Build timed out after 120000 ms (raise DEV_PROXY_BUILD_TIMEOUT_MS); the build may still have succeeded, re-run manually to confirm" — instead ofBuild failed:. This is the part that actually costs time: the message sends you looking for a build regression that isn't there.Impact
Dev tooling only (
tools/dev-proxy/), no effect on the shipped server. Worth fixing because the docker group is unusable throughdev_rebuild_and_restarton a cold cache, and the misreport is convincing enough to derail a debugging session — it did during a/testdebuggersweep, where the docker group had to be rebuilt out-of-band and restarted withdev_restart_debugger.