Repository navigation
test(macos): block real process fallthrough - #113337
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 24, 2026, 10:08 AM ET / 14:08 UTC. ClawSweeper reviewWhat this changesThe PR prevents macOS tests from executing an unmocked real gateway daemon command, recognizes SwiftPM test helpers, serializes shared launch-agent tests, and replaces an SSH-orphan test with a current-process metadata probe. Merge readinessThis fresh, maintainer-labeled PR remains necessary as the landing vehicle for macOS test isolation. The patch appears correct: it keeps the production gateway path outside the DEBUG-only guard, blocks test fallthrough before command resolution, and replaces a real SSH child with deterministic process-metadata coverage; the remaining action is normal merge review after the active macOS checks finish. Priority: P3 Review scores
Verification
How this fits togetherThe macOS app’s launch-agent manager invokes gateway lifecycle commands, while native IPC tests exercise those paths. Test-runner detection selects a DEBUG-only test safeguard so tests must explicitly intercept daemon commands instead of reaching the operator’s installed gateway CLI. flowchart LR
A[macOS IPC tests] --> B[Test-runner detection]
B --> C[Launch-agent manager]
C --> D{Explicit test interception?}
D -->|Yes| E[Mocked daemon result]
D -->|No during tests| F[Fail-closed test error]
D -->|Production build| G[Gateway CLI command]
A --> H[Process metadata coverage]
Before merge
Agent review detailsSecurityNone. PR surfaceOther +22. Total +22 across 5 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused DEBUG-only isolation guard once the active macOS checks complete and the rebased merge result still proves that release builds retain the existing gateway-command path. Do we have a high-confidence way to reproduce the issue? Yes, from source and the PR’s focused test: disable interception in a DEBUG test process, invoke a gateway daemon action, and verify it returns the explicit fail-closed error instead of resolving the real CLI. The supplied proof reports that this path was observed after the change. Is this the best way to solve the issue? Yes. Guarding the single daemon-command execution boundary in DEBUG test processes is narrower and safer than relying on each test to install a hook, while replacing the live SSH child removes the fixed-port and orphan-process hazard without changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7dfb660d1f80. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
2c7ed37 to
e1a07ff
Compare
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
|
Merged via squash.
|
…224005-host * origin/main: (72 commits) fix: macOS-only Parallels smoke harness regression (#75293) fix(ios): use configured speech language for system voice (#113372) refactor: centralize isolated agent test ownership (#115340) test(ui): stabilize browser route readiness (#115320) fix(cron): clear automation after failed scheduler shutdown (#115316) fix: keep isolated gateway workspaces and skills inside state dir (#114487) docs: document local TTS on macOS, Linux, and Windows (#110230) fix(tasks): clone only the requested task page (#114277) fix(agents): prevent Code Mode resume loss and unbounded preparation (#115314) fix(process): preserve the first process cancellation reason (#115317) fix(nostr): report unavailable ingress when queue open fails (#115313) fix: prevent Slack and Feishu ingress startup leaks (#115295) fix(slack): avoid unsafe emphasis boundaries (#111575) fix: prevent changed checks from expanding into full lint (#115322) fix(codex): stabilize prompts and expose real cache regressions (#115238) refactor(ui): derive page route specs from the route table (#115214) fix(compaction): plan cut points in trigger units (#111886) (#115309) fix: prevent cron and gateway stress-run timeouts (#115241) fix(ci): validate frozen Matrix QA targets (#115298) test(macos): block real process fallthrough (#113337) ... # Conflicts: # CHANGELOG.md
* test(macos): block real process fallthrough * test(macos): cover SwiftPM helper executable paths Co-authored-by: Peter Steinberger <[email protected]> * test(macos): avoid process-age timing assumption Co-authored-by: Peter Steinberger <[email protected]>
…afea23-host * origin/main: (72 commits) fix: macOS-only Parallels smoke harness regression (openclaw#75293) fix(ios): use configured speech language for system voice (openclaw#113372) refactor: centralize isolated agent test ownership (openclaw#115340) test(ui): stabilize browser route readiness (openclaw#115320) fix(cron): clear automation after failed scheduler shutdown (openclaw#115316) fix: keep isolated gateway workspaces and skills inside state dir (openclaw#114487) docs: document local TTS on macOS, Linux, and Windows (openclaw#110230) fix(tasks): clone only the requested task page (openclaw#114277) fix(agents): prevent Code Mode resume loss and unbounded preparation (openclaw#115314) fix(process): preserve the first process cancellation reason (openclaw#115317) fix(nostr): report unavailable ingress when queue open fails (openclaw#115313) fix: prevent Slack and Feishu ingress startup leaks (openclaw#115295) fix(slack): avoid unsafe emphasis boundaries (openclaw#111575) fix: prevent changed checks from expanding into full lint (openclaw#115322) fix(codex): stabilize prompts and expose real cache regressions (openclaw#115238) refactor(ui): derive page route specs from the route table (openclaw#115214) fix(compaction): plan cut points in trigger units (openclaw#111886) (openclaw#115309) fix: prevent cron and gateway stress-run timeouts (openclaw#115241) fix(ci): validate frozen Matrix QA targets (openclaw#115298) test(macos): block real process fallthrough (openclaw#113337) ... # Conflicts: # CHANGELOG.md
What Problem This Solves
macOS unit tests can race shared launch-agent test hooks and fall through to the real
openclaw gatewayCLI. Another unit test launches a real orphaned SSH child on a fixed port solely to inspect process metadata.Why This Change Was Made
In DEBUG test processes, un-intercepted daemon commands now fail closed before command resolution or
ShellExecutorexecution.ProcessInfo.isRunningTestsnow recognizes SwiftPM'sswiftpm-testing-helperand legacyswiftpm-xctest-helperrunners, with injectable resolver coverage. The launch-agent suite is serialized.The real SSH child test is replaced by a current-process metadata probe. Orphan/reap classification remains covered by the adjacent synthetic process-info matrix, so the unit suite no longer launches SSH or depends on a fixed port.
User Impact
macOS tests can no longer invoke the operator's real gateway CLI or create stray SSH children. Production release behavior is unchanged; the fail-closed branch is DEBUG-only and test-runner-gated.
Evidence
git diff --check: passedRaw
swift testrequired staging SwiftPM's built Sparkle framework into the disposable XCTest bundle before execution; exact-head macOS CI owns the normal packaged test environment.AI-assisted: yes.