GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcpx: inlineDaemon's cancel-during-poll path (PR #320) has no regression test — ablating it leaves the suite green · Issue #323 · developing-today/code

mcpx: inlineDaemon's cancel-during-poll path (PR #320) has no regression test — ablating it leaves the suite green #323

New issue
Copy link
New issue
Copy link
Closed
#330
Closed
mcpx: inlineDaemon's cancel-during-poll path (PR #320) has no regression test — ablating it leaves the suite green#323
#330
Copy link
Assignees
dezren39

Description

@dezren39
dezren39
opened on Oct 19, 2026
Issue body actions

Finding

PR #320 (port of dezren39/darwin-nix#430, merge 355caf1) made inlineDaemon honour context cancellation in three places in pkgs/mcpx/internal/cli/connect.go (current main ca1abca):

  1. entry ctx.Err() check — connect.go:216
  2. the answer poll now selects on ctx.Done() vs the poll interval — connect.go:261-269
  3. a post-loop ctx.Err() check before reporting the generic timeout — connect.go:271-274

Only (1) is pinned by a test. The two tests the PR added in pkgs/mcpx/internal/cli/inlinedaemon_test.go are TestInlineDaemonAlreadyCancelledContext (entry check only — it returns before any daemon starts) and TestInlineDaemonStartsWithLiveContext (the empty-config daemon answers the first Ping, so the poll wait is never meaningfully entered). Neither test cancels a context while the poll is waiting, and neither exercises the genuine-timeout path.

Ablation-verified in this review: in a scratch worktree of current main, replacing the poll select with a plain time.Sleep and deleting the post-loop check (entry check kept) leaves both new tests green:

--- PASS: TestInlineDaemonAlreadyCancelledContext (0.00s)
--- PASS: TestInlineDaemonStartsWithLiveContext (0.01s)

So the headline behaviour of the fix — a caller who cancels during the up-to-5s inline start wait gets a prompt context.Canceled and the in-process daemon is stopped, instead of burning the full daemon.inlineStartTimeout and reporting the in-process daemon did not answer — can regress silently.

The sibling fix in the same package sets the bar: EnsureDaemon has TestEnsureDaemonCancelledWhileWaiting (ensuredaemon_test.go:62) alongside its already-cancelled and never-ready tests, using a fake daemon binary, a 30s connect timeout, and a cancel at 200ms. inlineDaemon has no equivalent. (A deterministic mid-poll test here needs Ping to keep failing while the context is live — the empty-config daemon answers at once — so it may need a minimal seam: a daemon whose health endpoint never answers, a blocked/slow ServeInline, or an extracted poll helper.)

Affected repos (one set — mcpx lives in both)

  • developing-today/code: pkgs/mcpx/internal/cli/connect.go:261-274, pkgs/mcpx/internal/cli/inlinedaemon_test.go (PR fix(mcpx): honour a cancelled context in inlineDaemon (port of dezren39/nix#430) #320, commit e766ac1)
  • dezren39/nix: identical code and tests — pkgs/mcpx/internal/cli/connect.go:265-271 (select/post-loop), inlinedaemon_test.go identical (origin fix for mcpx: inlineDaemon ignores a cancelled context — waits out the full 5s inline timeout and reports 'did not answer' (SET: nix + code) dezren39/darwin-nix#430)

Why it matters

This is the same unpinned-wait pattern this repo already treated as worth an issue once (#319, fixed by PR #322): a wait/cancellation branch whose removal leaves the suite green. Cancellation during startup is the common real-world case (user hits Ctrl-C while mcpx is starting), not the already-cancelled one.

Acceptance criteria

  • A test in inlinedaemon_test.go cancels the context while inlineDaemon is waiting for the daemon to answer, and asserts: prompt return (well under the inline start timeout), errors.Is(err, context.Canceled), and the in-process daemon is stopped.
  • The test is ablation-verified: reverting the poll select to time.Sleep (or removing the post-loop check, for the path it covers) makes it fail.
  • The same test lands in dezren39/nix's mcpx copy in the same pass (cross-repo set; this issue is the single tracker).

Found by the pr-diff-review job reviewing PR #320.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 19, 2026
  2. dezren39 commented on Oct 19, 2026

    @dezren39
    dezren39
    on Oct 19, 2026
    MemberAuthor
    More actions

    Set in flight, both halves ablation-verified locally:

    • developing-today/code PR test(mcpx): pin inlineDaemon's cancel-during-poll paths (#323) #330 (this repo): inlineDaemonPing seam + 3 tests (mid-poll cancel / deadline-exit cancel / genuine timeout).
    • dezren39/nix PR lab-ops-hub: public Worker has no auth on mutating, upload, AI and crawl endpoints (PR #436) #441: byte-identical mirror, referencing this issue.

    Ablations: select→time.Sleep fails the mid-poll test in both repos (5.02s / 5.01s, no prompt return); removing the post-loop check fails the deadline-exit test ('the in-process daemon did not answer'). Full internal/cli suites green in both copies; go vet + build clean in code.

  3. dezren39
    added a commit that references this issue on Oct 19, 2026

    Merge pull request #330 from developing-today/sweep/323-inlinedaemon-…

    6b41442
  4. dezren39
    closed this as completedin #330on Oct 19, 2026
  5. dezren39 commented on Oct 19, 2026

    @dezren39
    dezren39
    on Oct 19, 2026
    MemberAuthor
    More actions

    Set complete: code PR #330 MERGED (6b41442) and dezren39/nix PR #441 MERGED (c78bba65), both with fully green CI (incl. the mcpx nix build legs). Fix re-verified on both merged mains: inlineDaemonPing seam present at connect.go:216/268 via API in both repos, and all 5 inlineDaemon tests pass on code main 6b41442 and nix main c78bba65 in fresh detached checkouts. This issue auto-closed by PR #330's 'Fixes #323'.

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

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.