Skip to content

fix(daemon): surface self-eviction blocker in logs (#51)#58

Merged
zackees merged 1 commit intomainfrom
fix/issue-51-daemon-eviction-diagnostics
Apr 17, 2026
Merged

fix(daemon): surface self-eviction blocker in logs (#51)#58
zackees merged 1 commit intomainfrom
fix/issue-51-daemon-eviction-diagnostics

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented Apr 17, 2026

Summary

  • Add DaemonContext::busy_reason() returning a human-readable reason ("build/deploy operation in progress", "N open serial sessions", "N pending serial attaches") or None when idle.
  • Promote self-eviction diagnostics from debug! to info! so users see: (a) when the daemon goes idle and the countdown starts, (b) what's keeping it alive when it can't evict, with a 60s periodic reminder so stuck sessions are visible without tick-by-tick log spam.
  • Tests cover empty/busy states and multi-blocker joining.

Context

Partially addresses #51: the reporter saw fbuild-daemon.exe staying resident after autoresearch finished, but the existing self-eviction logic (empty for 120 s → shutdown) logs only at debug level. That made the behavior invisible and indistinguishable from "eviction is broken." This PR surfaces the blocker at info so the next time someone hits this, the daemon log says exactly what's keeping it alive (e.g., Daemon staying alive: 1 pending serial attach). The underlying eviction logic is unchanged.

Test plan

  • uv run cargo clippy --workspace --all-targets -- -D warnings clean
  • uv run cargo test -p fbuild-daemon --lib — 88 passed
  • CI green on Linux / macOS / Windows

🤖 Generated with Claude Code

Previously the self-eviction loop logged idle/busy transitions only at
debug level, so users who saw `fbuild-daemon.exe` staying resident had no
visibility into whether self-eviction was ticking or what was keeping it
alive. Add `DaemonContext::busy_reason()` returning a human-readable
blocker (operation in progress, N open serial sessions, N pending
attaches) and promote idle-countdown + blocker messages to info level,
with a 60s periodic reminder while a blocker persists.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Warning

Rate limit exceeded

@zackees has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 13 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 25 minutes and 13 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b2e952eb-5837-483b-882d-75320e440ddc

📥 Commits

Reviewing files that changed from the base of the PR and between 0f01103 and a14461a.

📒 Files selected for processing (2)
  • crates/fbuild-daemon/src/context.rs
  • crates/fbuild-daemon/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-51-daemon-eviction-diagnostics

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 and usage tips.

@zackees zackees merged commit 09db259 into main Apr 17, 2026
76 checks passed
@zackees zackees deleted the fix/issue-51-daemon-eviction-diagnostics branch April 17, 2026 15:42
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