GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cli): status/doctor use identity-verified live proxy by Wibias · Pull Request #642 · lidge-jun/opencodex

Conversation

@Wibias

@Wibias Wibias commented Jul 28, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

  • ocx status --json and ocx doctor prefer findLiveProxy() over ocx.pid alone so a healthy Task Scheduler proxy is not reported stopped.
  • Missing PID file remains a separate concern; verified live proxies report running: true.

Test plan

  • bun run typecheck
  • CI green

Closes #618

Summary by CodeRabbit

  • Bug Fixes
    • Improved ocx status accuracy by verifying proxy liveness through health checks and runtime information.
    • Corrected reported proxy status and process IDs when stale or missing PID files are encountered.
    • Enhanced ocx doctor diagnostics to identify live proxies more reliably.
    • Prevented memory checks and restart guidance from relying on outdated proxy information.
    • Improved detection and recovery of running proxies when runtime records or PID files are incomplete.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Wibias
fix(cli): status/doctor use identity-verified live proxy
e87deb2
Closes #618
@Wibias
Wibias requested review from Ingwannu and lidge-jun as code owners July 28, 2026 17:37
@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

ocx status and ocx doctor now use identity-verified proxy liveness from findLiveProxy, including orphaned runtime records. LiveProxy identifies its discovery source, while status PID/health output and doctor runtime diagnostics derive from the verified live result.

Changes

Proxy diagnostics

Layer / File(s) Summary
LiveProxy discovery source and coverage
src/server/proxy-liveness.ts, tests/proxy-liveness.test.ts
LiveProxy reports whether discovery used runtime metadata or configured-port probing, with tests covering runtime, orphan recovery, fallback, and PID verification cases.
Status liveness precedence
src/cli/status.ts, tests/cli-status-json.test.ts
collectStatus() prefers findLiveProxy() results, preserves authoritative null PIDs, avoids duplicate health probing, and derives labels and JSON fields from verified liveness.
Doctor liveness diagnostics
src/cli/doctor.ts
runDoctor uses verified liveness for runtime data, process environment lookup, memory collection, and restart-hint state and port selection.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • lidge-jun/opencodex#569: Both changes modify findLiveProxy and the proxy-liveness module.

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main fix: status/doctor now rely on identity-verified live proxy discovery.
Linked Issues check ✅ Passed status and doctor now prefer findLiveProxy() for verified liveness, preserve missing-PID warnings, and avoid incorrect restart hints.
Out of Scope Changes check ✅ Passed The new proxy-liveness source field and tests directly support the status/doctor liveness fix, with no unrelated changes visible.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Wibias

Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@coderabbitai review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@Wibias, I’ll review the changes in #642, with particular attention to live-proxy verification, status/doctor behavior, and missing-PID-file edge cases.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Jul 28, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the bug Something isn't working label Jul 28, 2026
@Wibias Wibias linked an issue Jul 28, 2026 that may be closed by this pull request
[Bug]: status and doctor ignore an identity-verified live proxy when ocx.pid is missing #618
Closed
2 tasks done
chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Jul 28, 2026
View reviewed changes

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

Copy link
Copy Markdown

There was a problem hiding this comment.

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: 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/cli/status.ts Outdated
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();

@chatgpt-codex-connector chatgpt-codex-connector Bot Jul 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/cli/status.ts Outdated
// Prefer identity-verified liveness (runtime-port + /healthz) over ocx.pid alone (#618).
const live = await findLiveProxy();
const pidFile = readPid();
const pid = live?.pid ?? pidFile;

@chatgpt-codex-connector chatgpt-codex-connector Bot Jul 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread src/cli/status.ts Outdated
? {
port: live.port,
hostname: live.hostname,
source: "runtime" as const,

@chatgpt-codex-connector chatgpt-codex-connector Bot Jul 28, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Wibias added 3 commits July 28, 2026 19:54
@Wibias
fix(cli): avoid reload warn in status findLiveProxy path
e172a3e
@Wibias
Merge remote-tracking branch 'upstream/dev' into maintainer-takeover/…
4798aa0
…642-status-live-proxy
@Wibias
fix(cli): address Codex review on status/doctor live proxy
a53f6a4
Keep doctor on the read-only diagnostics config path. Preserve authoritative
null live pids, surface runtime vs config listen source from findLiveProxy,
and cover resolveStatusPid.
@Wibias

Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Addressed remaining Codex review on latest dig:

  • P1 doctor now passes diagnostics configFn (status already did in e172a3ec)
  • P2 resolveStatusPid / doctor use live ? live.pid : pidFile so authoritative null is kept
  • P2 findLiveProxy returns source: "runtime" | "config"; status JSON uses it

Focused tests: proxy-liveness, cli-status-json (+ typecheck).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Jul 29, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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 `@tests/cli-status-json.test.ts`:
- Around line 288-293: Strengthen the consumer-level regressions for an
identity-verified live proxy with a missing or stale PID file: in
tests/cli-status-json.test.ts:288-293, add a collectStatus() case asserting
running state, health/dashboard URLs, resolved PID, fallback port, and
listen.source; keep src/cli/status.ts:143-169 focused on the liveness-first
branch and ensure src/cli/status.ts:263-280 reports the verified proxy as
running. Add the matching doctor regression in src/cli/doctor.ts:722-736,
asserting at src/cli/doctor.ts:758-761 that diagnostics use the verified live
port and at src/cli/doctor.ts:824-825 that no unnecessary proxy-restart hint is
emitted.
🪄 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 Plus

Run ID: f6c93a91-92eb-466e-915f-53cc96ca4e8d

📥 Commits

Reviewing files that changed from the base of the PR and between a4fb284 and a53f6a4.

📒 Files selected for processing (5)
  • src/cli/doctor.ts
  • src/cli/status.ts
  • src/server/proxy-liveness.ts
  • tests/cli-status-json.test.ts
  • tests/proxy-liveness.test.ts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/cli-status-json.test.ts
Comment on lines +288 to +293
test("resolveStatusPid preserves an authoritative null from live orphan checks", () => {
expect(resolveStatusPid({ pid: null }, 4242)).toBeNull();
expect(resolveStatusPid({ pid: 1111 }, 4242)).toBe(1111);
expect(resolveStatusPid(null, 4242)).toBe(4242);
expect(resolveStatusPid(null, null)).toBeNull();
});

@coderabbitai coderabbitai Bot Jul 29, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Add consumer-level regressions for verified live proxies without a usable PID file.

The new unit test only validates resolveStatusPid; it cannot catch incorrect status JSON/URLs or doctor restart and memory behavior when findLiveProxy() discovers an orphaned runtime record.

  • tests/cli-status-json.test.ts#L288-L293: add a collectStatus() regression with a missing/stale PID file and identity-verified runtime-record proxy; assert running, health/dashboard URLs, resolved PID, fallback port, and listen.source.
  • src/cli/status.ts#L143-L169: keep the status regression focused on the liveness-first branch.
  • src/cli/status.ts#L263-L280: assert the returned JSON reports the verified proxy as running even without a valid PID file.
  • src/cli/doctor.ts#L722-L736: add a doctor regression for the same scenario.
  • src/cli/doctor.ts#L758-L761: assert doctor fetches runtime diagnostics from the verified live port.
  • src/cli/doctor.ts#L824-L825: assert doctor does not emit an unnecessary proxy-restart hint.

As per path instructions, “A behavior change in src/ should come with a focused regression test near the existing tests for that subsystem.”

📍 Affects 3 files
  • tests/cli-status-json.test.ts#L288-L293 (this comment)
  • src/cli/status.ts#L143-L169
  • src/cli/status.ts#L263-L280
  • src/cli/doctor.ts#L722-L736
  • src/cli/doctor.ts#L758-L761
  • src/cli/doctor.ts#L824-L825
🤖 Prompt for 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.

In `@tests/cli-status-json.test.ts` around lines 288 - 293, Strengthen the
consumer-level regressions for an identity-verified live proxy with a missing or
stale PID file: in tests/cli-status-json.test.ts:288-293, add a collectStatus()
case asserting running state, health/dashboard URLs, resolved PID, fallback
port, and listen.source; keep src/cli/status.ts:143-169 focused on the
liveness-first branch and ensure src/cli/status.ts:263-280 reports the verified
proxy as running. Add the matching doctor regression in
src/cli/doctor.ts:722-736, asserting at src/cli/doctor.ts:758-761 that
diagnostics use the verified live port and at src/cli/doctor.ts:824-825 that no
unnecessary proxy-restart hint is emitted.

Source: Path instructions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Wibias
Wibias merged commit e6169b0 into lidge-jun:dev Jul 29, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jul 29, 2026
port(go): status/doctor live-proxy parity from #642 #678
Closed
fix(cli): carry status/doctor live proxy onto dig2-go (#642) #679
Merged
Wibias added a commit that referenced this pull request Jul 29, 2026
@Wibias
fix(cli): carry status/doctor live proxy onto dig2-go (#642)
2f2c83c
Carries #642. Go port deferred: #678.
@Wibias

Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Transition complete:

  • dev: e6169b0e
  • dev2-go carry: fix(cli): carry status/doctor live proxy onto dig2-go (#642) #679
  • Go port: deferred → port(go): status/doctor live-proxy parity from #642 #678 (needs-go-port)
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Wibias
Wibias deleted the fix/618-status-live-proxy branch July 30, 2026 19:05
This was referenced Jul 31, 2026
fix(service): make Windows scheduler stop actually stop the proxy #780
Merged
fix(security): retry required ACL harden after soft timeout #782
Merged
Add post-sync readiness endpoint and bounded ocx ready wait #569
Merged
fix: harden credential and runtime trust boundaries (rebase of #916) #936
Merged
This was referenced Aug 8, 2026
fix(cli): check live proxy before journal recovery #1269
Closed
fix(cli): bind local diagnostic reads to runtime #1448
Merged
fix(oauth): attest credential-free live provider reloads #1541
Merged
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@Wibias
fix(cli): status/doctor use identity-verified live proxy (lidge-jun#642)
b1b7cfd
Fixes lidge-jun#618. Prefer findLiveProxy over ocx.pid alone; keep status/doctor read-only on malformed config; preserve authoritative null live pids and runtime vs config listen source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@lidge-jun lidge-jun Awaiting requested review from lidge-jun lidge-jun is a code owner
@Ingwannu Ingwannu Awaiting requested review from Ingwannu Ingwannu is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: status and doctor ignore an identity-verified live proxy when ocx.pid is missing

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Wibias
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.