Repository navigation
feat(mcpx): daemon transport interface + tsnet identity listener (#1967) - #2203
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f2fa3dc249
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The branch was cut from a local main carrying repo-keeper snapshot commits; bin/sessions.json is machine-local state, not part of the tsnet transport change. Restore it to origin/main.
The treefmt PR gate (nix-ci.yml, added 2026-10-12) checks changed files, and configuration.md's tables were never prettier-formatted. Adding the daemon.tsnet.hostname row therefore makes prettier rewrite every table row in the file. Apply the formatter once so the gate passes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d5d620b37
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… treefmt TestTheDocumentationListsEverySetting byte-compares the generated section of docs/configuration.md against settings.Registry(); the prettier format commit padded those tables, failing the test (and the nix build) on every CI run. Regenerate with the test -update flag and add configuration.md to the treefmt excludes next to parity.md, which is excluded for exactly this reason.
|
Agent note — queue task 2902, Lane D, 2026-10-29 CI failure on head
Codex findings disposition (merge gate — this PR does not merge until each is fixed or answered):
Task 2902 is parked on: CI for |
…(PR #2203) - takeover: predecessor closes its tsnet node before kindEnd and the successor recreates the identity listener in commitTakeover before committing (listenTSNet factored out of Listen); a handover that does not commit recreates it in restoreHTTP. - takeover: sendConns drains connections with no descriptor (tsnet gonet conns) via release() instead of aborting the upgrade. - origin: the Host check distinguishes the tailnet listener (local addr in 100.64/10 or the Tailscale ULA) and requires this daemon's own tailnet name/address there, keeping the loopback rule intact for the loopback listener. - tsnet: Listen awaits Up() with a bounded context so an expired or revoked auth key fails startup instead of silently never joining. - tsnet: ephemeral clients get an in-memory state store, so a client process cannot stay attached to a previous tailnet's node. - tsnet: the client dialer verifies the destination is a peer (or itself) on the authenticated tailnet before dialing; tsnet Dial otherwise falls back to system DNS and plain TCP. Tests: TestTailnetLocalIP, TestTailnetHost (incl. the mcpx-daemon.evil.example rejection), TestSendConnsDrainsDescriptorless on the laptop; daemon takeover/handoff/upgrade groups pass.
TestNoPackageRedeclaresADefault failed on the tsnet transport's const tsnetUpTimeout: timeouts belong in internal/defaults/defaults.json. Moves it to daemon.tsnetUpTimeout (30s, unchanged) and consumes it from internal/defaults. Refs #1967
|
agent-note:v1 — worker Parked: CI pending on Root cause of the earlier red on 3ad2372: Fixed in 71b237d:
Local verification: Resume: read checks on 71b237d, then Codex re-review, then merge. Task 2902 parked 20 min. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71b237dd1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… dir per config Codex re-review of PR #2203 (head 71b237d) findings: - P1 takeover.go: closeTSNetNode closed the tsnet node without stopping the tracked connListener, so the blocked Accept forwarded the tsnet listener-close error to httpErr and Serve treated it as fatal during a handover. Stop the wrapper first so Accept converts it to http.ErrServerClosed. - P2 server.go: every daemon shared <state>/tsnet as node state, so a second configured daemon loaded the first daemon's node keys and its auth key was ignored. tsnetStateDir now keys the directory by the FingerprintConfig file-set identity (stable across takeover), with the unkeyed dir kept for config-less daemons. Regression test TestTSNetStateDirKeyedByConfig.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14b2c40ef6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… drain + cold-join budget (#1967) 1. passConns now stops the tracked tsnet connListener alongside the unix/TCP listeners, before the connection sweep and Registry.Detach — a tailnet connection accepted after the sweep was gathered by nobody and could reach a detached pool or be cut by the node shutdown. stop() closes only the inner listener; the node stays ours until closeTSNetNode, and restoreHTTP re-listens on the same node when a handover that stopped it does not commit. 2. TSNetDialer gains ensureJoined: the first dial waits for the ephemeral node to reach Running once, with the daemon.tsnetUpTimeout (30s) budget on a background context instead of the caller 2s health-probe deadline — a cold join (registration + auth) bounded by autostart.pingTimeout made Connect reject a healthy daemon, and every new process repeated the cold join. Tests: go test ./internal/daemon/ full package pass on the laptop.
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
CI re-run evidence (queue task 2902, openchamber scheduled lane)
Same head, run locally on the laptop: That is the whole e2e package, green, on the exact CI head — so the red check is most likely a timing-sensitive e2e test rather than a deterministic regression from d9e4197 (the same branch was green at 71b237d, and d9e4197 touches only Next step on resume (task parked 20 min, resume brief on #1967): re-run the failed |
|
🤖 Agent note · parked
|
First implementation slice for #1967 (queue task 2902), per the merged decision doc (tsnet as the first identity transport; iroh/cgo rejected there and not revisited).
What this does
internal/daemon/transport.go: aTransportinterface (transports produce anet.Listener).Server.Listennow binds the unix socket and TCP throughunixTransport/tcpTransport— behaviour unchanged, existing daemon tests untouched and passing.internal/daemon/transport_tsnet.go: a tsnet transport behind the same interface. New settingdaemon.tsnet.hostname(default empty = off) names the daemon's tailnet identity; the node state lives under<state>/tsnetso the MagicDNS name is stable. The auth key is read from theTS_AUTHKEYenvironment variable only — never a setting, so it cannot land in a config file or settings dump. With a hostname set but no key,Listenfails with that reason: no silent fallback to a local-only daemon.daemon.endpointgrows thetsnet://<name>[:port]scheme (default port 80, matching the listener). The client joins the tailnet as an ephemeral node (mcpx-client) to dial it; a malformedtsnet://endpoint and a missing key both produce clear errors at dial time, never a retry of the name as plain TCP.Server.TSNetStatusexposes the node's identity plus per-peer direct-vs-relayed state (from tsnet's local API) for the status surface to render.Verified on the laptop (CI is the authority)
go vet ./internal/daemon/ ./internal/cli/ ./internal/settings/cleango test ./internal/daemon/ -run 'Transport|TSNet|ParseTSNet'pass — builtin transports bind/dial through the interface, endpoint parsing, and both no-auth-key failure modesgo test ./internal/settings/pass (docs/configuration.md regenerated for the new setting)Known remaining pieces (not hidden)
pkgs/mcpx/package.nixvendorHashmust be updated for the newtailscale.commodule tree before the nix build leg can pass — being worked as a follow-up commit on this branch.Refs #1967. The browser-reachability question escalated to Drew on #1967 is untouched by this slice (phone-yes / browser-no per the decision doc).
🤖 queue task 2902, lane A
Need help on this PR? Tag
@codesmith-botwith what you need.