fix(cli): status/doctor use identity-verified live proxy - #642
Conversation
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@codex review |
|
✅ Action performedReview finished.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e87deb20e1
ℹ️ 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".
| const listen = selectListenTarget(config, pid, pid ? readRuntimePort(pid) : null); | ||
| const health = await checkProxyHealth(listen); | ||
| // Prefer identity-verified liveness (runtime-port + /healthz) over ocx.pid alone (#618). | ||
| const live = await findLiveProxy(); |
There was a problem hiding this comment.
Keep status and doctor on the read-only config path
When the config is malformed, these new findLiveProxy() calls default their configFn to loadConfig(), which invokes warnAndBackupInvalidConfig; consequently, even with no PID/runtime record, ocx status --json and ocx doctor now create a new config.json.invalid-* file and emit a warning to stderr. This breaks the explicit read-only behavior covered by tests/cli-status-json.test.ts:244-271 and can accumulate backups every time diagnostics are run. Pass the already-read diagnostics config into findLiveProxy (and do likewise for the call in doctor.ts) or provide a non-mutating config reader.
AGENTS.md reference: AGENTS.md:L93-L95
Useful? React with 👍 / 👎.
| // Prefer identity-verified liveness (runtime-port + /healthz) over ocx.pid alone (#618). | ||
| const live = await findLiveProxy(); | ||
| const pidFile = readPid(); | ||
| const pid = live?.pid ?? pidFile; |
There was a problem hiding this comment.
Preserve a null PID from orphan liveness checks
When an orphaned runtime record answers with a legacy, PID-less health response while ocx.pid names a different still-running Ocx-shaped process, findLiveProxy() deliberately returns pid: null so the stale PID is not attributed to that listener, but this nullish fallback immediately restores pidFile. The label and JSON then claim the verified live proxy has that unrelated PID, and the analogous fallbacks in doctor.ts:724,732 inspect that process as the proxy. Use live ? live.pid : pidFile so a live result's authoritative null is preserved, and cover this caller behavior with a focused regression test.
AGENTS.md reference: AGENTS.md:L93-L95
Useful? React with 👍 / 👎.
| ? { | ||
| port: live.port, | ||
| hostname: live.hostname, | ||
| source: "runtime" as const, |
There was a problem hiding this comment.
Preserve config as the source of fallback listen targets
If both PID/runtime metadata are absent or unusable but the proxy answers on config.port, findLiveProxy() succeeds through its configured-port fallback; this branch nevertheless reports listen.source as "runtime". That makes the documented JSON runtime/config source inaccurate precisely in the missing-state scenario this change handles. Have liveness return its discovery source, or retain "config" when the successful target came from the configured fallback.
AGENTS.md reference: AGENTS.md:L96-L97
Useful? React with 👍 / 👎.
Summary
ocx status --jsonandocx doctorpreferfindLiveProxy()overocx.pidalone so a healthy Task Scheduler proxy is not reported stopped.running: true.Test plan
bun run typecheckCloses #618