Skip to content

feat(daemon): typed DaemonStatus model for all surfaces (#774) - #792

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/daemon-status-model
May 4, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/daemon-status-model

Conversation

@Sinity

@Sinity Sinity commented May 4, 2026

Copy link
Copy Markdown
Owner

Add Pydantic DaemonStatus with liveness check, component state, throughput, FTS/insight readiness.

Add Pydantic DaemonStatus model with sub-models for ComponentState,
SourceLagItem, IngestionThroughput, FTSReadiness, InsightFreshness.
Add build_daemon_status() constructor with daemon liveness check via
pidfile. Backward-compatible daemon_status_payload() still returns dict.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
Copilot AI review requested due to automatic review settings May 4, 2026 02:08
@Sinity
Sinity merged commit dd9df5b into master May 4, 2026
@Sinity
Sinity deleted the feature/feat/daemon-status-model branch May 4, 2026 02:08
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

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

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ 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: ASSERTIVE

Plan: Pro

Run ID: 7ee201ee-d450-4f14-a754-c63375d9e49e

📥 Commits

Reviewing files that changed from the base of the PR and between 4d74586 and a4d2c79.

📒 Files selected for processing (1)
  • polylogue/daemon/status.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/daemon-status-model

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
Review rate limit: 0/1 reviews remaining, refill in 50 minutes and 23 seconds.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4d2c791c7

ℹ️ 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".

Comment thread polylogue/daemon/status.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a typed DaemonStatus Pydantic model in polylogue/daemon/status.py to serve as a shared daemon status representation across multiple surfaces, while keeping the existing dict-based daemon_status_payload() for backward compatibility.

Changes:

  • Added Pydantic sub-models and a top-level DaemonStatus model for structured daemon status.
  • Added build_daemon_status() plus a pidfile-based liveness check helper.
  • Extended the legacy daemon_status_payload() and plain-text formatting to include daemon liveness + component state.
Comments suppressed due to low confidence (1)

polylogue/daemon/status.py:270

  • daemon_status_payload() builds a DaemonStatus (which already computes DB info / FTS readiness / blob_dir_size_bytes) and then recomputes _db_size_info(), _fts_readiness_info(), and _blob_size_info() again. _blob_size_info() does a full rglob() + stat() walk, so this doubles an expensive filesystem traversal and can also produce inconsistent values if the filesystem changes between calls. Consider reusing the values from status (and pass the already computed watch_sources into build_daemon_status to avoid calling default_sources() twice).
    status = build_daemon_status(
        sources=sources,
        browser_capture_spool_path=browser_capture_spool_path,
    )

    db_info = _db_size_info()
    blob_size = _blob_size_info()
    fts = _fts_readiness_info()


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +185 to +186
if isinstance(value, int | float) and not isinstance(value, bool):
return int(value)
Sinity added a commit that referenced this pull request May 7, 2026
Add Pydantic DaemonStatus with liveness check, component state,
throughput, FTS/insight readiness.

Co-authored-by: Claude Opus 4.7 <[email protected]>
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 64.F004 / P1: fixed-already at the checked revision: polylogue/daemon/status.py:2989 derives browser_capture_active from the explicit browser_capture_enabled setting and otherwise enables the default receiver. It no longer uses the presence of a spool-path override, so a default status request does not falsely disable capture for that reason.

Only the rows listed above are dispositioned. Held findings remain open.

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.

2 participants