Title: mcpx: inlineDaemon's cancel-during-poll path (PR #320) has no regression test — ablating it leaves the suite green · Issue #323 · developing-today/code · GitHub
Open Graph Title: mcpx: inlineDaemon's cancel-during-poll path (PR #320) has no regression test — ablating it leaves the suite green · Issue #323 · developing-today/code
X Title: mcpx: inlineDaemon's cancel-during-poll path (PR #320) has no regression test — ablating it leaves the suite green · Issue #323 · developing-today/code
Description: 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): entry ctx.Err() check — connect.go:216 the answer...
Open Graph Description: 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): entry ctx...
X Description: 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): entry ctx...
Opengraph URL: https://github.com/developing-today/code/issues/323
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx: inlineDaemon's cancel-during-poll path (PR #320) has no regression test — ablating it leaves the suite green","articleBody":"## Finding\n\nPR #320 (port of dezren39/nix#430, merge 355caf10) made `inlineDaemon` honour context cancellation in three places in `pkgs/mcpx/internal/cli/connect.go` (current main ca1abca0):\n\n1. entry `ctx.Err()` check — connect.go:216\n2. the answer poll now selects on `ctx.Done()` vs the poll interval — connect.go:261-269\n3. a post-loop `ctx.Err()` check before reporting the generic timeout — connect.go:271-274\n\nOnly (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.\n\n**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:\n\n```\n--- PASS: TestInlineDaemonAlreadyCancelledContext (0.00s)\n--- PASS: TestInlineDaemonStartsWithLiveContext (0.01s)\n```\n\nSo 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.\n\nThe 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.)\n\n## Affected repos (one set — mcpx lives in both)\n\n- developing-today/code: `pkgs/mcpx/internal/cli/connect.go:261-274`, `pkgs/mcpx/internal/cli/inlinedaemon_test.go` (PR #320, commit e766ac1e)\n- dezren39/nix: identical code and tests — `pkgs/mcpx/internal/cli/connect.go:265-271` (select/post-loop), `inlinedaemon_test.go` identical (origin fix for dezren39/nix#430)\n\n## Why it matters\n\nThis 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.\n\n## Acceptance criteria\n\n- 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.\n- 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.\n- The same test lands in dezren39/nix's mcpx copy in the same pass (cross-repo set; this issue is the single tracker).\n\nFound by the pr-diff-review job reviewing PR #320.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-19T00:21:10Z","url":"https://github.com/developing-today/code/issues/323"}
| 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:9f081a2f-5492-59e8-2de2-6332155f2917 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 86B0:1352AF:15F1C8:1D5F30:6B0610FB |
| html-safe-nonce | 214b022340cdd75803d9539d266a17f94dfd7072c981587a881445608f0b0905 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkIwOjEzNTJBRjoxNUYxQzg6MUQ1RjMwOjZCMDYxMEZCIiwidmlzaXRvcl9pZCI6IjE4MTQ3MDE1MzkyMjc3MzQyNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 83f737b0e35aa369b7a291f76b6226e166d5fa55d506d558e1899d26393d34d0 |
| hovercard-subject-tag | issue:5915693185 |
| 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/323/issue_layout |
| twitter:image | https://opengraph.githubassets.com/709c381d38a8f18496a096a551e134b4824999bb829a201cad042443c21a6508/developing-today/code/issues/323 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/709c381d38a8f18496a096a551e134b4824999bb829a201cad042443c21a6508/developing-today/code/issues/323 |
| og:image:alt | 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): entry ctx... |
| 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 | e58943f0186bb8d97b217393c2724a49ab47e4aefefc43595a90fa04699066c9 |
| 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 | 23517473abc6d5da019b4958bd421644e98a418b |
| 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