Skip to content

mcpx(settings): reject non-positive ticker intervals before NewTicker #3467

Closed

Description

@dezren39

Problem

KindDuration validation currently accepts syntactically valid zero and negative durations. Three settings are passed directly to time.NewTicker, which panics for non-positive values:

  • daemon.reapInterval — internal/daemon/server.go:580
  • daemon.saveInterval — internal/daemon/server.go:582
  • http.ssePing — internal/daemon/server.go:1560

Triage evidence

  • internal/settings/value.go:499-509 parses KindDuration values but only has a special minimum for protoTasks.maxTTL; there is no positive-interval rule.
  • daemon.reapInterval and daemon.saveInterval are declared in internal/settings/registry.go:522-531 with positive defaults.
  • http.ssePing is declared in internal/settings/wire.go:61-67 with a positive default.
  • daemon/routes_exec.go:117-121 guards artifacts.gcInterval <= 0 by substituting the default; internal/mcpserver/timing.go:85-87 similarly resolves nonpositive transport.sseKeepAlive to its default. Preserve these existing fallback behaviors.
  • daemon.idleExit is intentionally zero-capable: internal/settings/wire.go:276-282 says zero means never, and daemon/server.go:661-665 treats <=0 as disabled.
  • Other ticker sites in mcpx use fixed or built-in default intervals, not registry settings.

Scope

Make validation reject zero and negative values for the three direct ticker settings above, with an error naming the setting/value. Keep legitimate-zero settings such as daemon.idleExit accepted; do not blanket-reject zero for all KindDuration values. Preserve the guarded fallback semantics for artifacts.gcInterval and transport.sseKeepAlive.

Acceptance

  • Tests show 0s and -5s are rejected for daemon.reapInterval, daemon.saveInterval, and http.ssePing.
  • A test shows daemon.idleExit=0s remains valid.
  • Guarded settings retain their fallback behavior and no validated duration reaches a direct NewTicker with a nonpositive period.
  • Existing internal/settings and internal/daemon tests pass.

Related: #2613, #1697, #1758.

Acceptance criteria

  • Non-positive or non-finite ticker intervals in mcpx settings are rejected at validation time with a clear error naming the setting, before any NewTicker call can panic.
  • Valid positive intervals behave exactly as before (existing settings tests unchanged and green).
  • A regression test covers zero, negative, and (where representable) NaN interval inputs.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/queue-workerFiled or worked by the queue/worker pilot
    priority/normalOrdinary priority (the default)
    app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: queued

  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: triage-update

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: ses_e5e69850e4cffe0Uz3xXzb37V1 / queue task 3855
    • Finding: On clean main 199d9f2 (worktree /home/user/git/fleet/3855 has no changes), go test ./internal/settings currently fails in unrelated baseline tests: TestEveryDocumentHasAChapter (three manifest files), TestNoUndeclaredEnvRead (MCPX_ADAPTER_DECLARATION_SHA256), TestEverySettingHasAnEffectProbeOrAnExemption (11 settings), and TestTheScriptEnvironmentIsWhatTheCodeSets (three undeclared environment setters). go test ./internal/settings -run 'TestProtoTasks' passes. Please verify whether the full-suite baseline has changed before attributing those failures to this fix.
    • Links: clean-main SHA 199d9f2; issue mcpx(settings): reject non-positive ticker intervals before NewTicker #3467
  5. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: filed by a queue lane during triage of the mcpx settings surface (task packet evidence on the issue). No merged PR references this issue as of this run (checked gh pr list --state merged --search 3467).

    Notes: the failure mode is a runtime panic from time.NewTicker on a non-positive duration — a config-validation gap, so the fix belongs at the settings boundary, not at call sites. Risk: low; reject-at-load must not break existing deployed configs that rely on a zero value meaning "disabled" — the worker should check for that convention first and, if it exists, map zero to disabled explicitly instead of erroring.

    Suggested approach: validate in the settings loader, add the regression tests, run the mcpx package tests via CI.

    🤖 Agent note · done

    • Agent: fleet monitor
    • Session / ID: repo-fleet-monitor run 2026-11-01T10:12Z
    • Found via: monitor reconciliation
    • Task: intake enrichment (protocol §5) — acceptance criteria appended, labels normalized, this review posted
    • Expectation: effort as labelled; done = acceptance criteria on the issue met by a fix PR
  6. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    and removed on Nov 1, 2026
  7. 17 remaining items

  8. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Lane E resumed task 5402: PR #4220 head ca87fd4 revalidated — MERGEABLE, latest Codex round on this head has no findings (earlier P1 fixed in the follow-up commit and replied to), verification documented on the PR (new ticker tests 3/3, daemon package ok, 5 settings failures proven pre-existing on clean main). The nix build check remains QUEUED (infra stall, same pattern as run 41392609663). Merging per standing merge authority.

  10. added a commit that references this issue on Nov 2, 2026
  11. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    Done: PR #4220 merged (merge commit c6055bd); issue #3467 closed by the merge. Codex clean on final head; ticker-interval validation tests pass, remaining settings failures pre-existing on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/mcpxPackage/app: mcpx (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/queue-workerFiled or worked by the queue/worker pilottask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions