Title: fix(mcpx): honour a cancelled context in inlineDaemon (port of dezren39/nix#430) by dezren39 · Pull Request #320 · developing-today/code · GitHub
Open Graph Title: fix(mcpx): honour a cancelled context in inlineDaemon (port of dezren39/nix#430) by dezren39 · Pull Request #320 · developing-today/code
X Title: fix(mcpx): honour a cancelled context in inlineDaemon (port of dezren39/nix#430) by dezren39 · Pull Request #320 · developing-today/code
Description: Port of the fix for dezren39/darwin-nix#430 — the single origin issue for this cross-repo set (mcpx lives in both repos and internal/cli/connect.go was byte-identical in both). No separate code issue was filed, per the one-issue-per-set rule. What inlineDaemon (the connection ladder's last rung, pkgs/mcpx/internal/cli/connect.go) ignored context cancellation — the #233/EnsureDaemon defect class left in this sibling wait: No ctx.Err() check on entry: it started an in-process daemon for a caller who had already gone away. The answer poll was a plain time.Sleep. Ping is ctx-bound, so under a cancelled context it could never succeed: the loop always burned the full daemon.inlineStartTimeout (5s default), tore a working daemon down, and reported the misleading the in-process daemon did not answer. Now: entry check returns ctx.Err() before anything starts; the poll wait selects on ctx.Done() vs the poll interval (the EnsureDaemon pattern); a post-loop ctx.Err() check covers cancellation landing on the last poll. The genuine-timeout path and inlineStop() cleanup are unchanged. Evidence Reproduced pre-fix in the nix copy with a temporary test (empty config, already-cancelled ctx): elapsed=5.023s err=the in-process daemon did not answer isCanceled=false. New inlinedaemon_test.go (identical in both repos): TestInlineDaemonAlreadyCancelledContext — ablation-verified in the nix copy: fails pre-fix (5.03s, generic error), passes post-fix (0.00s, context.Canceled, no daemon started). TestInlineDaemonStartsWithLiveContext — the uncancelled path still returns a pingable client. Full internal/cli suite green locally in this repo; gofmt clean. Need help on this PR? Tag @codesmith-bot with what you need. Summary by CodeRabbit Bug Fixes Starting an in-process daemon now responds to cancellation promptly, including when cancellation occurs while waiting for the daemon to become available. If startup is canceled, the daemon is stopped and the cancellation error is returned instead of continuing to wait or reporting a timeout.
Open Graph Description: Port of the fix for dezren39/darwin-nix#430 — the single origin issue for this cross-repo set (mcpx lives in both repos and internal/cli/connect.go was byte-identical in both). No separate code iss...
X Description: Port of the fix for dezren39/darwin-nix#430 — the single origin issue for this cross-repo set (mcpx lives in both repos and internal/cli/connect.go was byte-identical in both). No separate code iss...
Opengraph URL: https://github.com/developing-today/code/pull/320
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c185accb-1bdf-f4c3-393c-10775b8ad126 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 85AC:5F360:368CE5:4789E9:6B0617AC |
| html-safe-nonce | 71215e08b8afbc4043a5386d1e9dfcbb40f84ae691146679fc1812d34bc55062 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUFDOjVGMzYwOjM2OENFNTo0Nzg5RTk6NkIwNjE3QUMiLCJ2aXNpdG9yX2lkIjoiNzQzMjM5NTAxMTUwMzAzNjMzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 37069b7c35cdbe9e21bca5cb1a5fb0b73d8390cc6a435b5b240946674335fb3d |
| hovercard-subject-tag | pull_request:4913802281 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/developing-today/code/pull/320/files |
| twitter:image | https://avatars.githubusercontent.com/u/11225574?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/11225574?s=400&v=4 |
| og:image:alt | Port of the fix for dezren39/darwin-nix#430 — the single origin issue for this cross-repo set (mcpx lives in both repos and internal/cli/connect.go was byte-identical in both). No separate code iss... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width