GeezerVison is showing github.com — mcpx(exec): per-request exec timeout disables the bound entirely (0/negative = no limit) or raises it without a ceiling — operator exec.timeout is replaced, not bounded · Issue #2398 · developing-today/code
mcpx(exec): per-request exec timeout disables the bound entirely (0/negative = no limit) or raises it without a ceiling — operator exec.timeout is replaced, not bounded #2398Descriptionmcpx(exec): per-request exec timeout can disable the timeout entirely (0/negative) or raise it without any ceiling — the operator's exec.timeout is replaced, not bounded
Summary
A /v1/exec caller controls the script timeout completely. execsvc.Service.Run replaces the operator-resolved Limits.Timeout (the exec.timeout setting, default 120s) with any time.ParseDuration-valid per-request value, with no positivity check and no ceiling:
timeout: "0s", "0", or any negative value ("-1s", "-100h") → the runner applies no deadline at all — the script runs unbounded.
timeout: "876000h" (~100 years) → the bound is raised ~2.6 million× above the operator's 120s, again unbounded in practice.
Evidence (main 5a34fa70)
pkgs/mcpx/internal/daemon/routes_exec.go:218 — handleExec JSON-decodes the request, Options included, verbatim; nothing validates options.timeout.
pkgs/mcpx/internal/execsvc/execsvc.go:349-356:
timeout := s.Limits.Timeout
if opts.Timeout != "" {
d, err := time.ParseDuration(opts.Timeout)
if err != nil { return nil, fmt.Errorf(...) }
timeout = d
}
The only check is parseability. The resolved value is handed to the runner at execsvc.go:377 (Timeout: timeout).
pkgs/mcpx/internal/daemon/routes_exec.go:173 — Limits.Timeout is the operator's setting: lim.Timeout = set.Duration("exec.timeout"); pkgs/mcpx/internal/settings/exec.go:16 declares exec.timeout, default "120s".
pkgs/mcpx/internal/runner/runner.go:62-63 — Timeout on the runner: "Timeout bounds execution; 0 means no limit." runner.go:273: if opts.Timeout > 0 { runCtx, cancel = context.WithTimeout(...) } — a zero or negative timeout therefore installs no deadline.
- The first-party CLI never sends a disabling value over the wire —
pkgs/mcpx/internal/cli/exec.go:562-564 guards if rf.timeout > 0 { opts.Timeout = rf.timeout.String() } — but the daemon side has no equivalent guard, so any non-CLI caller (plugin, MCP client, raw HTTP) can send one. (Locally, --timeout 0 = no limit at internal/cli/commands.go:598 is a documented operator choice for the user's own process; the daemon path is a service acting on behalf of callers, where the operator's exec.timeout is the protection being silently removed.)
Probe (this run, laptop, verbatim resolution + runner gate)
Probe: ~/git/fleet/probe-2026-10-29-laneA-exectimeout/ (main 5a34fa70), operator limit 120s:
opt="" -> effective timeout=2m0s runner applies deadline: true
opt="30s" -> effective timeout=30s runner applies deadline: true
opt="0s" -> effective timeout=0s runner applies deadline: false
opt="0" -> effective timeout=0s runner applies deadline: false
opt="-1s" -> effective timeout=-1s runner applies deadline: false
opt="-100h" -> effective timeout=-100h runner applies deadline: false
opt="876000h" -> effective timeout=876000h runner applies deadline: true (~100 years)
Why it matters
exec.timeout exists so a daemon operator can bound how long any one script may run. Today that bound is advisory: a single request field removes it entirely (0/negative) or inflates it past any useful horizon, so a hung, looping, or hostile script holds a daemon worker, its runtime process, and any pooled upstream connections indefinitely. This is the same shape as the per-request TTL ceilings filed for tasks/artifacts (#2351, #2327) but for the execution bound itself — and it cuts against the house rule already recorded for the sibling setting in #1864: a caller may lower a daemon-set bound, not raise it past the operator's ceiling (the ClampedBy principle in internal/settings/clamp.go).
Not a duplicate: #1758 (closed) is the adapter timeout, where a negative value made calls fail instantly — the opposite failure in a different subsystem. #1864 is pool.callTimeout call-scoping for upstream tool calls, not the exec script timeout in execsvc.
Acceptance criteria
-
POST /v1/exec with options.timeout of "0", "0s", or any negative duration no longer produces an unbounded run: it is either refused with a named error or treated as "no override" (the operator's exec.timeout applies) — one rule, pinned at triage, applied in execsvc.Run so every entry point (HTTP, task mode) gets it.
- A positive per-request timeout larger than the operator's resolved
exec.timeout is clamped to that ceiling (caller may lower, not raise), or refused — per the same pinned rule.
- A smaller positive timeout (e.g.
"30s" against a 120s limit) still takes effect exactly as today.
- Regression tests cover the boundary inputs:
"0", "-1s", a value above the limit, a value below it, and the absent-option default.
- The local CLI's documented
--timeout 0 = no limit behaviour for direct local runs (internal/cli/commands.go:598, runner path) is unchanged.
Activitydeveloping-today commented on Oct 29, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo) effort/xsTrivial: expected under 30 minutes of work on Oct 29, 2026dezren39 commented on Oct 29, 2026 🤖 Agent note · filed
- Agent: new-issue-creator (lane A, new-issue-creator-code-a)
- Session / ID: cron job new-issue-creator-code-a, run 2026-10-29T18:13Z
- Found via: filed this run
- Task: Triage the mcpx execsvc per-request timeout override (execsvc.go:349-356 → runner.go:273): 0/negative removes the deadline entirely, huge values raise it past the operator's exec.timeout (default 120s) with no ceiling; pin refuse-vs-clamp-vs-ignore (expected: caller may lower, not raise or disable) and route a small_fix packet.
- Expectation: effort/xs — done when the override rule is pinned for the execsvc entry point and a fix packet with boundary regression tests is routed.
- Links: evidence in issue body; laptop probe
/git/fleet/probe-2026-10-29-laneA-exectimeout/ (main 5a34fa7: ""→120s bounded, 30s→bounded, 0s/0/-1s/-100h→no deadline, 876000h→100y)
dezren39 commented on Nov 1, 2026 🤖 Agent note · parked — CI still queued; Codex clean, diff verified
- Agent: repo-worker-code, Lane B shift
- Session / ID: queue task 5276 (small_fix, resume of the parked awaiting-CI state)
- State: PR mcpx(exec): bound the per-request timeout — refuse non-positive, clamp to operator exec.timeout (#2398) #3421 @975aacc1d026 — Codex review completed with no findings (has_any_findings=false, verified fresh); diff re-read this shift and matches the pinned rule exactly (non-positive refused, above-limit clamped, operator-limit-0 unclamped; 12-case resolver table + Run-level refusal test; laptop
go test ./internal/execsvc/ passed at PR creation).
- Blocker: GitHub check runs (basic: lint / plugin tests / docs-history, stress: PR changed tests, build: mcpx-docs) still queued after >5 min of polling — not failed, not started. Per the worker CI rule this task parks instead of waiting.
- Next: on resume, if checks are green → merge PR mcpx(exec): bound the per-request timeout — refuse non-positive, clamp to operator exec.timeout (#2398) #3421, close mcpx(exec): per-request exec timeout disables the bound entirely (0/negative = no limit) or raises it without a ceiling — operator exec.timeout is replaced, not bounded #2398, complete task 5276 as fixed_merged. If a check fails on the change, fix forward on the same branch.
dezren39 commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|