Skip to content

[codex] Harden core reliability - #35

Merged
ygsgdbd merged 1 commit into
mainfrom
codex/harden-core-reliability
Jul 23, 2026
Merged

[codex] Harden core reliability#35
ygsgdbd merged 1 commit into
mainfrom
codex/harden-core-reliability

Conversation

@ygsgdbd

@ygsgdbd ygsgdbd commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR hardens ListenBar's two core reliability paths: collecting listener data from lsof and maintaining the fallback LaunchAgent used for launch at login. It also updates the product roadmap with the current feature priorities and enables XCTest timeouts for the new process stress tests.

Problem and user impact

The port scanner previously waited for the child process to exit before draining stdout and stderr. A child that produced enough output could fill either pipe and block forever, leaving ListenBar's refresh stuck. The scanner could also accept parseable stdout from a non-zero lsof exit and publish an incomplete snapshot.

The fallback login-item path wrote its final plist before launchctl bootstrap completed. If bootstrap failed, the remaining plist could make the app report launch at login as enabled even though the service had not loaded. Similar ambiguity existed when committing a staged plist failed.

Root cause

Process termination and pipe consumption were sequenced instead of coordinated concurrently, and the lsof parser treated usable output as success without first requiring a zero exit status. The LaunchAgent installation was not transactional: its status marker was visible before service registration succeeded, and rollback did not consistently separate staging artifacts from the committed plist.

Changes

  • Drain child stdout and stderr concurrently with DispatchIO while awaiting process termination asynchronously.
  • Reject all non-zero lsof exits before parsing stdout, while retaining the existing status-code fallback message.
  • Add large dual-stream and processor-count stress coverage, including process-launch failure and partial-output regression cases.
  • Stage fallback LaunchAgent plists in a hidden directory, bootstrap from staging, and commit only after bootstrap succeeds.
  • Use the gui/<uid>/<label> service target for bootout and clean up staged and committed artifacts on failed installation.
  • Add regression coverage for bootstrap, cleanup, move, and replacement failures.
  • Record the remaining restoration of a pre-existing fallback plist as deferred LaunchAtLogin rollback hardening in ROADMAP.md.
  • Enable XCTest timeouts and cap individual tests at 15 seconds so a pipe-draining regression cannot hang CI indefinitely.
  • Update ROADMAP.md to reflect implemented ignored-process controls and the current priorities for watched ports, history, diagnostics, manual refresh, and automation integrations.

Validation

  • rtk just check
  • rtk git diff --check
  • Focused LaunchAtLogin and PortScanner XCTest runs during development

@ygsgdbd ygsgdbd changed the title Harden core reliability [codex] Harden core reliability Jul 23, 2026
@ygsgdbd
ygsgdbd marked this pull request as ready for review July 23, 2026 08:56
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ygsgdbd
ygsgdbd merged commit 99e082d into main Jul 23, 2026
2 checks passed
@ygsgdbd
ygsgdbd deleted the codex/harden-core-reliability branch July 23, 2026 08:56
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