Skip to content

Commit c7854a6

Browse files
committed
fix(telemetry): add 500ms timeout to ps call in process tree detection
Prevents CLI from hanging indefinitely on macOS if ps is unresponsive during agent detection at startup.
1 parent 9be1de9 commit c7854a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/detect-agent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ export function getProcessInfoFromOS(pid: number): ProcessInfo | undefined {
207207
{
208208
encoding: "utf-8",
209209
stdio: ["pipe", "pipe", "ignore"],
210+
// Guard against ps hanging on degraded systems — this runs
211+
// synchronously during CLI startup, so keep it tight
212+
timeout: 500,
210213
}
211214
);
212215
// Output: " 1234 /Applications/Cursor.app/Contents/MacOS/Cursor"

0 commit comments

Comments
 (0)