Skip to content

fix(cli): allow status on large archives - #1427

Merged
Sinity merged 2 commits into
masterfrom
fix/status-large-archive-timeout
May 22, 2026
Merged

Sinity merged 2 commits into
masterfrom
fix/status-large-archive-timeout

Conversation

@Sinity

@Sinity Sinity commented May 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Increase the explicit polylogue status daemon timeout so large live archives can return the real daemon status payload instead of falling back to a false no-daemon diagnostic.

Problem

On the live workstation archive, /api/status can take about 20s after a full rebuild while still returning a healthy daemon payload. The CLI used a 5s timeout for explicit polylogue status --format json, caught the timeout as a generic OSError, and reported daemon_liveness=false / no_daemon even though polylogued.service was running and listening.

Solution

Keep the bare-command fast probe at 1s, but raise the explicit status command timeout to 30s. Operator-requested status can wait for the complete archive health payload without changing fast startup behavior.

Verification

  • python - <<'PY' ... import check confirmed _FULL_TIMEOUT_S == 30.0 and _FAST_TIMEOUT_S == 1.0
  • python -m pytest tests/unit/cli/test_json_envelope_contract.py::TestStatusJsonContract -q -> 2 passed
  • pre-push quick gate -> all steps ok, total 44.0s

Note: a broader tests/unit/cli run remains red from unrelated existing help snapshot/plain-output/cursor failures on this branch.

Summary by CodeRabbit

  • Bug Fixes
    • Increased daemon health check timeout to improve CLI stability and reduce premature fallback to local status handling.

Review Change Stack

Problem: polylogue status used a 5s daemon timeout and treated any timeout as daemon absence. On the live workstation archive, the daemon status payload can take around 20s after a rebuild, so the CLI incorrectly reported no daemon while /api/status eventually returned a healthy payload.\n\nWhat changed: keep the fast bare-command probe at 1s, but raise the explicit status command timeout to 30s so operator-requested status can wait for the full archive health payload.\n\nVerification: python import check for _FULL_TIMEOUT_S == 30.0; pytest tests/unit/cli/test_json_envelope_contract.py::TestStatusJsonContract -q. Broad tests/unit/cli remains red from unrelated existing help snapshot/plain-output/cursor failures on this branch.
@coderabbitai

coderabbitai Bot commented May 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 54 minutes and 7 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1c5fb1f7-9a8a-497a-9036-e8db9ba6f9ee

📥 Commits

Reviewing files that changed from the base of the PR and between 963873f and c76ac8b.

📒 Files selected for processing (1)
  • polylogue/cli/commands/status.py
📝 Walkthrough

Walkthrough

The CLI daemon health check HTTP request timeout is increased from 5.0 to 30.0 seconds, extending the time the status command waits for the daemon to respond before falling back to local status handling.

Changes

Daemon Health Query Timeout

Layer / File(s) Summary
Daemon health timeout adjustment
polylogue/cli/commands/status.py
The _FULL_TIMEOUT_S constant increases from 5.0s to 30.0s, allowing the status command more time to receive daemon responses before falling back to local execution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit awaits with patient ears,
Five became thirty, easing fears,
More time to check the daemon's beat,
Before retreat is then replete! 🐰⏱️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: increasing timeout to handle large archives in the status command.
Description check ✅ Passed The description covers all required template sections with clear problem statement, solution, and verification details.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/status-large-archive-timeout

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@polylogue/cli/commands/status.py`:
- Around line 14-16: Add brief inline comments next to the timeout constants to
document the rationale: annotate _FAST_TIMEOUT_S with a note that it is a quick
probe timeout for bare `polylogue` invocation and annotate _FULL_TIMEOUT_S
noting it provides buffer (e.g., 30s) because large archives can take ~20s for
/api/status; leave _BUILTIN_DAEMON_URL as-is or add a short comment if helpful.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0275101d-3be0-45e7-8b05-fde73c80b827

📥 Commits

Reviewing files that changed from the base of the PR and between 0856e4f and 963873f.

📒 Files selected for processing (1)
  • polylogue/cli/commands/status.py

Comment thread polylogue/cli/commands/status.py Resolved
Document why the bare command keeps a 1s daemon probe while explicit status waits up to 30s for large archive health payloads.\n\nVerification: python import check for status timeout constants; pytest tests/unit/cli/test_json_envelope_contract.py::TestStatusJsonContract -q.
@Sinity
Sinity merged commit fe35852 into master May 22, 2026
5 checks passed
@Sinity
Sinity deleted the fix/status-large-archive-timeout branch May 22, 2026 23:23
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