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(server): harden drain-and-restart spawn failure path (#580 follow-up) by Wibias · Pull Request #594 · lidge-jun/opencodex

Conversation

@Wibias

@Wibias Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follow-up to feat(dashboard): drain-and-restart from memory observability card (#563) #580 / issue-author note: wait for detached ocx start spawn success before markRecyclingForExit + exit(0).
  • On sync spawn throw or pre-start error, exit 1 without recycling so a drained process does not stay latched or die with no replacement.
  • Adds regression coverage for sync throw and async rejection paths.

Test plan

  • bun test tests/system-restart.test.ts
  • bun run typecheck
  • bun run privacy:scan
  • CI green on Linux/Windows/macOS

Sorry, something went wrong.

Uh oh!

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

All reactions
@Wibias
fix(server): exit cleanly when drain-and-restart spawn fails
10c3d23
Follow-up to #580: wait for detached start spawn success, and on sync throw or pre-start error exit(1) without markRecycling so we never leave a drained process latched or exit(0) with no replacement.
@Wibias
Wibias requested review from Ingwannu and lidge-jun as code owners July 28, 2026 03:23
@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

Warning

Review limit reached

@Wibias, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 22 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b385ae94-564e-4fc1-a879-2125e66ea839

📥 Commits

Reviewing files that changed from the base of the PR and between 903b62c and 2bdb7a8.

📒 Files selected for processing (2)
  • src/server/management/system-restart.ts
  • tests/system-restart.test.ts
✨ 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.

@github-actions github-actions Bot added the bug Something isn't working label Jul 28, 2026
@Wibias Wibias mentioned this pull request Jul 28, 2026
feat(dashboard): drain-and-restart from memory observability card (#563) #580
Merged
5 of 8 tasks
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: 10c3d236b4

ℹ️ 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/server/management/system-restart.ts Outdated
Comment on lines +139 to +140
const detail = err instanceof Error ? err.message : "unknown error";
console.warn(`⚠️ Drain-and-restart spawn failed (${detail}); exiting without replacement`);

@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 Sanitize the spawn error before logging it

When the detached restart fails with errors such as ENOENT, Bun and Node include the executable's absolute path in err.message; because process.execPath commonly contains the OS username, this warning persists an account identifier in console or service logs. Log only a stable error code or sanitize user-specific path components instead of interpolating the raw message.

AGENTS.md reference: AGENTS.md:L98-L99

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread src/server/management/system-restart.ts
Comment on lines +141 to +142
// Listen socket is already stopped; do not markRecycling — no child to inherit fences.
exitProcess(1);

@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 Restore proxy fences before exiting on spawn failure

When the proxy was launched by handleEnsure or the tray's direct-start path, it inherits OCX_SERVICE=1 even when no service is installed, so a spawn failure reaches this branch but syncCleanup skips both restoreNativeCodex() and stripGrokConfig() because that environment marker is still set. Exiting here therefore leaves Codex and Grok configured to use the listener that was just stopped; clear the service marker or invoke explicit failure cleanup before exiting, and add focused coverage for this unsupervised-daemon path.

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
@Wibias
fix(server): sanitize restart spawn errors and restore fences
2bdb7a8
Address Codex review on #594: log only errno codes (no pathful messages), and clear inherited OCX_SERVICE on spawn failure so ensure/tray daemons still run syncCleanup restore.
@Wibias
Wibias merged commit e545512 into lidge-jun:dev Jul 28, 2026
9 checks passed

Uh oh!

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

@Wibias
Wibias deleted the fix/580-restart-spawn-failure branch July 28, 2026 03:56
@luvs01 luvs01 mentioned this pull request Jul 30, 2026
[Bug][Windows]: tray host can retain inherited proxy socket handles and keep the old port bound after restart #733
Closed
2 tasks done
@luvs01 luvs01 mentioned this pull request Aug 6, 2026
fix(lifecycle): bind in-place proxy restart to runtime identity #1131
Closed
4 of 7 tasks
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@Wibias
fix(server): harden drain-and-restart spawn failure path (lidge-jun#580…
99ea517
… follow-up) (lidge-jun#594)

* fix(server): exit cleanly when drain-and-restart spawn fails

Follow-up to lidge-jun#580: wait for detached start spawn success, and on sync throw or pre-start error exit(1) without markRecycling so we never leave a drained process latched or exit(0) with no replacement.

* fix(server): sanitize restart spawn errors and restore fences

Address Codex review on lidge-jun#594: log only errno codes (no pathful messages), and clear inherited OCX_SERVICE on spawn failure so ensure/tray daemons still run syncCleanup restore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

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

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.