Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

test(desktop): validate Python probe execution (#1653)

天魔b4b626a0e7ef
diff --git a/apps/desktop/src/main/scheduler-host/__tests__/scriptRunnerPythonProtocol.test.ts b/apps/desktop/src/main/scheduler-host/__tests__/scriptRunnerPythonProtocol.test.ts
index f355c6eba7..03f703cb7d 100644
--- a/apps/desktop/src/main/scheduler-host/__tests__/scriptRunnerPythonProtocol.test.ts
+++ b/apps/desktop/src/main/scheduler-host/__tests__/scriptRunnerPythonProtocol.test.ts
@@ -22,8 +22,12 @@ const PYTHON_CLIENT_DIR = fileURLToPath(new URL('../python-client/', import.meta
function detectPython(): string | null {
for (const cmd of ['python', 'python3']) {
try {
- const probe = spawnSync(cmd, ['--version'], { windowsHide: true, timeout: 10_000 });
- if (probe.status === 0) return cmd;
+ const probe = spawnSync(cmd, ['-c', 'import sys; sys.stdout.write("cindy-python-probe")'], {
+ encoding: 'utf8',
+ windowsHide: true,
+ timeout: 10_000,
+ });
+ if (probe.status === 0 && probe.stdout === 'cindy-python-probe') return cmd;
} catch {
// try next candidate
}