Repository navigation
fix(cli): allow status on large archives - #1427
Conversation
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.
|
Warning Review limit reached
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 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. ChangesDaemon Health Query Timeout
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
polylogue/cli/commands/status.py
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.
Summary
Increase the explicit
polylogue statusdaemon 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/statuscan take about 20s after a full rebuild while still returning a healthy daemon payload. The CLI used a 5s timeout for explicitpolylogue status --format json, caught the timeout as a genericOSError, and reporteddaemon_liveness=false/no_daemoneven thoughpolylogued.servicewas 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.0and_FAST_TIMEOUT_S == 1.0python -m pytest tests/unit/cli/test_json_envelope_contract.py::TestStatusJsonContract -q-> 2 passedNote: a broader
tests/unit/clirun remains red from unrelated existing help snapshot/plain-output/cursor failures on this branch.Summary by CodeRabbit