Skip to content

Commit 86ecc89

Browse files
committed
fix: address review findings — error reporting, Wayland, timeout
- app-lifecycle.ts: emit diagnostic on fire-and-forget app launch failure instead of silently swallowing errors - linux-env.ts: make xdotool on Wayland a hard error instead of a broken fallback (xdotool doesn't work on Wayland) - atspi-bridge.ts: increase Python subprocess timeout from 15s to 30s for safety on slow/loaded systems with large a11y trees https://claude.ai/code/session_01H9hrmueNF5pcBM8JeX81mT
1 parent b4e89bf commit 86ecc89

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

src/platforms/linux/app-lifecycle.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { runCmd, whichCmd } from '../../utils/exec.ts';
2+
import { emitDiagnostic } from '../../utils/diagnostics.ts';
23
import { sendKey } from './input-actions.ts';
34

45
/**
@@ -18,7 +19,13 @@ export async function openLinuxApp(app: string): Promise<void> {
1819
// Try launching as a binary first
1920
if (await whichCmd(app)) {
2021
// Fire-and-forget: apps don't exit when launched
21-
runCmd(app, [], { allowFailure: true }).catch(() => {});
22+
runCmd(app, [], { allowFailure: true }).catch((err) => {
23+
emitDiagnostic({
24+
level: 'warn',
25+
phase: 'linux_app_launch',
26+
data: { app, error: String(err) },
27+
});
28+
});
2229
// Give it a moment to start
2330
await new Promise((resolve) => setTimeout(resolve, 500));
2431
return;

src/platforms/linux/atspi-bridge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export async function captureAccessibilityTree(
120120

121121
const result = await runCmd('python3', args, {
122122
allowFailure: true,
123-
timeoutMs: 15_000,
123+
timeoutMs: 30_000,
124124
});
125125

126126
if (result.exitCode !== 0) {

src/platforms/linux/linux-env.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import { whichCmd } from '../../utils/exec.ts';
99
import { AppError } from '../../utils/errors.ts';
10-
import { emitDiagnostic } from '../../utils/diagnostics.ts';
1110

1211
export type DisplayServer = 'wayland' | 'x11';
1312
export type InputTool = 'xdotool' | 'ydotool';
@@ -39,20 +38,9 @@ export async function ensureInputTool(): Promise<{
3938
cachedInputTool = { tool: 'ydotool', display };
4039
return cachedInputTool;
4140
}
42-
if (await whichCmd('xdotool')) {
43-
emitDiagnostic({
44-
level: 'warn',
45-
phase: 'linux_input_tool',
46-
data: {
47-
message: 'Falling back to xdotool on Wayland. Input synthesis may not work — install ydotool for full Wayland support.',
48-
},
49-
});
50-
cachedInputTool = { tool: 'xdotool', display };
51-
return cachedInputTool;
52-
}
5341
throw new AppError(
5442
'TOOL_MISSING',
55-
'ydotool is required for input synthesis on Wayland. Install it via your package manager.',
43+
'ydotool is required for input synthesis on Wayland (xdotool does not work on Wayland). Install it via your package manager.',
5644
);
5745
}
5846

0 commit comments

Comments
 (0)