Skip to content

feat(fleet): probe-based UDS/TCP transport selection for broker clients (#6218) - #8033

Merged
dezren39 merged 1 commit into
mainfrom
queue/14372-6218-probe-transport
Nov 9, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14372-6218-probe-transport

Conversation

@dezren39

@dezren39 dezren39 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Implements #6218 (from the #5699 design adopted 2026-11-05): fleet clients select UDS vs TCP per broker role by probing, instead of fixed routes.

What changed

  • fleet-config: new RoleTransport + Config::role_transport_choice(role) + probe_socket(path). Selection order: the [<role>] transport config preference wins ("tcp" = TCP without probing, "socket" = the role's Unix socket); with no preference, probe the role socket — file exists + connect succeeds selects UDS, absent or stale selects TCP. Probe behavior is unit-tested for socket-present, socket-absent, and socket-stale cases, plus the pure preference/probe matrix.
  • queue client (fleet-queue, client feature now depends on fleet-config):
    • broker_sock() asks fleet-config instead of hardcoding ~/.cache/laptop-agent/broker.sock (env > config file > the same compiled-in default; load error falls back to the home-anchored path).
    • Direct path is route-selected: an explicit REPO_QUEUE_BROKER_URL / broker-url file wins and gains a unix://<path> form; otherwise the probe choice for the queue-broker role selects a direct UDS roundtrip when the socket answers. A failed UDS attempt falls back to the session-proxy (TCP) route within the same call. Sandbox consumers are untouched: with no live role socket the client keeps the session-proxy route exactly as before.
  • queue-broker DirectSecrets: gains a unix:// form for QUEUE_BROKER_SECRETS_URL (same GET /secret/ exchange over the secrets broker's socket; connect failure falls back to the TCP endpoint in the same resolve), and the default endpoint is probe-selected via fleet-config when no URL is configured. Response handling is shared between the legs.
  • fleet secrets (laptop-local path): new DirectBrokerSource in fleet-secrets speaks plain HTTP over the secrets broker's own socket, reading the broker token from its token file. Resolver::default_chain prepends it only when the probe selects the socket (laptop); on the sandbox the chain is byte-for-byte the historical shape. fleet secrets list uses the direct source on the same condition.

Tests

Laptop, pkgs/fleet:

  • cargo test -p fleet-config — 26 passed (3 new: preference/probe matrix, probe live/absent/stale, role dispatch)
  • cargo test -p fleet-queue --all-features — 119 passed (new: configured-URL routing, shared response parsing, DirectSecrets endpoint selection + status mapping, UDS resolve roundtrip)
  • cargo test -p fleet-secrets — all passed (new: direct source resolve + list roundtrips over a temp socket, 404 mapping)
  • cargo test -p fleet -p fleet-dispatch — all suites ok

Queue task 14372 (lane code-h, direct execution lane).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 9, 2026 10:44
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-09T10:44:44.248866Z
We couldn’t complete this review. Comment @codex review to try again.
5d63b51 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 31cc9964-cbb9-4ff7-8925-5577965db1f9
Commits

Reviewing files that changed from the base of the PR and between d9e0f39 and 5d63b51.

Files selected for processing: 6

  • pkgs/fleet/crates/fleet-config/src/lib.rs
  • pkgs/fleet/crates/fleet-queue/Cargo.toml
  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/crates/fleet-queue/src/queue_broker.rs
  • pkgs/fleet/crates/fleet-secrets/src/lib.rs
  • pkgs/fleet/crates/fleet/src/secrets.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39

dezren39 commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

Codex findings disposition (task 14372 resume, lane code-f): the Codex code review on commit 5d63b51 FAILED to run — Codex usage limits for code reviews reached (see the Codex bot comment above); the review posted zero findings and zero review comments. There is therefore no undispositioned Codex finding on this PR. Local verification stands as recorded on issue #6218: fleet-config 26 pass, fleet-queue --all-features 119 pass, fleet-secrets pass, fleet + fleet-dispatch suites ok. PR checks remain QUEUED under the fleet-wide Actions stall; per standing merge authority (CI runs on main only; PRs do not wait for CI) this PR merges now and main CI is the verification surface.

@dezren39
dezren39 merged commit 5763542 into main Nov 9, 2026
2 of 5 checks passed
@dezren39
dezren39 deleted the queue/14372-6218-probe-transport branch November 9, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant