Repository navigation
fix(infra): bound macOS metadata probes - #109241
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 1:38 PM ET / 17:38 UTC. Summary PR surface: Source +4, Tests +59. Total +63 across 4 files. Reproducibility: no. there is not yet a high-confidence real current-main reproduction. Source inspection clearly exposes the unbounded synchronous calls, and the controlled Node probe validates the mechanism, but no actual macOS OpenClaw path was made to hang. Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the shared helper and bounded-probe design, then add redacted macOS terminal or log proof that the actual OpenClaw path exits within the deadline and preserves fallback metadata when shimmed Do we have a high-confidence way to reproduce the issue? No, there is not yet a high-confidence real current-main reproduction. Source inspection clearly exposes the unbounded synchronous calls, and the controlled Node probe validates the mechanism, but no actual macOS OpenClaw path was made to hang. Is this the best way to solve the issue? Yes, the proposed code shape is the narrowest maintainable fix: it reuses the existing infra helper and fallback contracts rather than adding a new API, asynchronous initialization path, or compatibility layer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cb84dc76fc05. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +4, Tests +59. Total +63 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
The synchronous git symbolic-ref probe runs during gateway prompt footer assembly. It had no timeout, so a stalled git process could block the gateway indefinitely. Add GIT_SYMBOLIC_REF_TIMEOUT_MS (5s) and SIGKILL, matching the bounded probe pattern applied to macOS system probes (openclaw#109241).
What Problem This Solves
The best-effort macOS metadata probes for
sysctl -n hw.modelandsw_vers -productVersionused synchronous child processes without deadlines. The presence probe runs during gateway module initialization, while the OS label is also used by gateway status and first-turn prompt preparation. A stalled system command could therefore block gateway startup or an agent turn indefinitely for metadata that already has fallback behavior.Why This Change Was Made
Apply the existing 5-second system-probe budget and
SIGKILLto both synchronous macOS commands. The presence module now reuses the infra-owned Darwin product-version helper instead of maintaining a second unboundedsw_versimplementation.The existing fallback contracts remain unchanged: a failed or timed-out model probe yields no model identifier, and a failed product-version probe falls back to
os.release(). This keeps the change local to the metadata owner and avoids changing synchronous module initialization or downstream APIs.User Impact
A stalled macOS metadata command can no longer hang gateway startup, status resolution, or prompt preparation forever. Healthy commands produce the same model and product-version values. In the failure case, users receive the existing best-effort fallback after a bounded wait.
Evidence
mainatb6e90cbed4c2immediately before PR creation; the reviewed patch-id remained unchanged across both rebases.node scripts/run-vitest.mjs src/infra/os-summary.test.ts src/infra/system-presence.version.test.ts-> 2 files, 16 tests passed.sysctlandsw_versarguments plustimeout: 5_000andkillSignal: "SIGKILL", and verify the resulting Darwin presence metadata.SIGTERM: theSIGKILLdeadline returnedETIMEDOUTin about 130 ms for a 120 ms test budget.oxfmt --check, targetedoxlint, andgit diff --checkpassed.Proof gap: no real macOS command-hang reproduction was available. The exact commands and fallback outputs are covered by focused tests, while the hard-kill behavior is covered by the controlled Node child-process probe.