Skip to content

Warn on daemon identity mismatches - #1006

Merged
zackees merged 1 commit into
mainfrom
fix/940-daemon-identity-warning
Jul 8, 2026
Merged

Warn on daemon identity mismatches#1006
zackees merged 1 commit into
mainfrom
fix/940-daemon-identity-warning

Conversation

@zackees

@zackees zackees commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

  • query /api/daemon/info before daemon-backed build/deploy/monitor/test-emu requests
  • warn when the serving daemon has a different fbuild version, a different checkout/spawner scope, or a different cache identity/schema
  • log the serving daemon identity at debug level for matched daemons

Closes #940

Scope note

This intentionally avoids changing default daemon port derivation. The low-risk slice makes cross-checkout collisions visible before the request is served by the wrong daemon; per-checkout endpoint isolation remains a broader behavior change.

Local validation

  • soldr cargo fmt --all --check
  • soldr --no-cache cargo test -p fbuild-cli daemon_identity_warning -> 5 passed
  • soldr --no-cache cargo check -p fbuild-cli --all-targets
  • soldr --no-cache cargo clippy -p fbuild-cli --all-targets -- -D warnings -> exit 0; repo still emits the existing clippy/Cargo MSRV config warning
  • git diff --check

Normal soldr cargo test -p fbuild-cli daemon_identity_warning failed before running tests in soldr's embedded compile dispatch (early eof), so the validation used soldr --no-cache to bypass that local cache layer.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@zackees, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f9e435a-feea-4920-8461-f01672ca1a16

📥 Commits

Reviewing files that changed from the base of the PR and between 7098660 and 67dd30a.

📒 Files selected for processing (4)
  • crates/fbuild-cli/src/cli/build.rs
  • crates/fbuild-cli/src/cli/deploy.rs
  • crates/fbuild-cli/src/daemon_client.rs
  • crates/fbuild-cli/src/daemon_client/identity.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/940-daemon-identity-warning

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

Comment @coderabbitai help to get the list of available commands.

@zackees
zackees merged commit ed5f908 into main Jul 8, 2026
90 of 93 checks passed
@zackees
zackees deleted the fix/940-daemon-identity-warning branch July 8, 2026 18:52
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 9, 2026
zackees added a commit that referenced this pull request Jul 9, 2026
…1009) (#1020)

Follow-up to #940/#1006 (which only *warned* on daemon identity mismatch). Two
fixes so a wrong-version daemon can no longer silently serve another checkout's
builds:

1. **Endpoint keyed by version + cache-identity.** `get_daemon_port()`'s default
   was a fixed per-user port (8765/8865) shared by every checkout. Now the
   endpoint is derived from `daemon_endpoint_key()` = FNV-1a of
   `CARGO_PKG_VERSION | DaemonCacheIdentity.label_value()`: `default_daemon_port()`
   maps it into the IANA dynamic range (49152–65535), and the port file is named
   `daemon-<key>.port`. Since fbuild-paths is workspace-versioned, the CLI and
   daemon derive the same key with no handshake — daemons of different versions
   land on distinct ports/files and can't serve each other; same-version+cache
   checkouts still (correctly) share. Dropped the old cross-mode port fallback
   (an anti-isolation bridge). `FBUILD_DAEMON_PORT` still overrides.

2. **Version arbitration, not mtime.** `ensure_direct_daemon_running` used
   `cli_binary_mtime > daemon_source_mtime` to decide restarts, so a freshly-built
   *older* binary (newer mtime) could evict a *newer* daemon. New pure
   `should_restart_daemon(cli_ver, daemon_ver, cli_mtime, daemon_mtime)`: restart
   iff the CLI is a newer semver (upgrade) or the same version was rebuilt
   (mtime); **never** evict a newer daemon. `HealthResponse.version` was already
   on the wire.

Tests: fbuild-paths endpoint-key/port derivation (deterministic, ranged, version
-distinct, keyed port file); fbuild-cli arbitration matrix (older-never-evicts,
newer-upgrades, same-version-mtime, unparseable-fallback). CLAUDE.md port docs
updated.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

Multi-checkout daemon collision: two repos share port 8765, wrong-version daemon serves both (stale flags, dead-endpoint deploys)

1 participant