← Back to PRs

#10030: Guard network interface enumeration

by TheAxumite open 2026-02-06 01:34 View on GitHub →
gateway stale size: XS
Handle os.networkInterfaces() errors in restricted environments to prevent CLI crashes. Also make systemd user service check tolerant when the user bus is unavailable. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR hardens system/environment probing paths used by the CLI/daemon. - In `src/infra/tailnet.ts`, it wraps `os.networkInterfaces()` so failures in restricted environments (e.g., sandboxed containers, limited /proc access) don’t crash the process. - In `src/infra/system-presence.ts` and `src/daemon/systemd.ts`, it makes “systemd user service present/running” checks tolerant of a missing/unreachable user D-Bus, avoiding false negatives and hard failures. Overall, the changes fit into the existing “system presence” detection and tailnet networking utilities by converting previously-throwing environment queries into best-effort checks that degrade gracefully. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - Changes are narrowly scoped to error-handling around environment detection (`os.networkInterfaces()` and systemd user-bus checks) and are unlikely to affect core functionality beyond preventing crashes in restricted environments. - No files require special attention <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs