{"record":{"id":"33d590a5d67d6447","repo":"stablyai/orca","slug":"playwright-did-not-return-a-pid","errorCode":null,"errorMessage":"Playwright did not return a PID","messagePattern":"Playwright did not return a PID","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-terminal-ibus-hangul-e2e.mjs","lineNumber":200,"sourceCode":"      [\n        'run',\n        'test:e2e:headful',\n        '--workers=1',\n        '--',\n        'tests/e2e/terminal-ibus-hangul-native.spec.ts'\n      ],\n      {\n        cwd: projectDir,\n        env: {\n          ...process.env,\n          ORCA_E2E_FORWARD_APP_LOGS: '1',\n          ORCA_E2E_NATIVE_IBUS_HANGUL: '1'\n        },\n        stdio: 'inherit'\n      }\n    )\n    if (!testProcess.pid) {\n      throw new Error('Playwright did not return a PID')\n    }\n    evidence.playwrightPid = testProcess.pid\n    console.error(`[terminal-ime] started Playwright PID ${testProcess.pid}`)\n    testExitCode = await waitForExit(testProcess)\n  } finally {\n    if (ibusProcess?.pid) {\n      evidence.ibusGroupBeforeCleanup = processGroupMembers(ibusProcess.pid)\n      evidence.ibusGroupAfterCleanup = await stopOwnedProcessGroup(ibusProcess.pid)\n    }\n    if (windowManagerProcess?.pid) {\n      evidence.windowManagerGroupAfterCleanup = await stopOwnedProcessGroup(\n        windowManagerProcess.pid\n      )\n    }\n    closeSync(ibusLogFd)\n    closeSync(windowManagerLogFd)\n    mkdirSync(path.join(projectDir, 'test-results'), { recursive: true })\n    copyFileSync(","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-terminal-ibus-hangul-e2e.mjs#L182-L218","documentation":"The harness spawns the Playwright test process (`pnpm run test:e2e:terminal-ibus-hangul-native`-style invocation) with stdio inherit and ORCA_E2E_NATIVE_IBUS_HANGUL=1. If spawn() returns no pid the test driver never launched, so awaiting testExitCode is impossible. Common when node/pnpm cannot be found or the project dir is wrong.","triggerScenarios":"The spawn of the Playwright runner fails to fork — wrong cwd (projectDir), missing node/pnpm on PATH in the inherited env, or the spawned command's binary is absent.","commonSituations":"projectDir resolved incorrectly (run from outside repo root); pnpm not on PATH inside the X11 session env; the test script name changed in package.json so the spawn command is invalid; node binary moved.","solutions":["Confirm projectDir points at the repo root where package.json and the e2e script exist.","Ensure pnpm and node are on PATH in process.env inherited by the spawn (the session env block does not re-export PATH).","Run the Playwright command by hand inside an xvfb session to surface the fork error."],"exampleFix":"// before\n// projectDir wrong or pnpm missing on PATH -> no pid\n// after\n// run from repo root and verify pnpm\nwhich pnpm && pnpm run test:e2e:terminal-ibus-hangul-native","handlingStrategy":"validation","validationCode":"const { spawnSync } = require('node:child_process')\nif (spawnSync('which', ['pnpm']).status !== 0 || !existsSync(projectDir + '/package.json')) {\n  console.error('pnpm missing or projectDir invalid'); process.exit(1)\n}","typeGuard":"function hasPid(child: { pid?: number }): child is { pid: number } {\n  return typeof child.pid === 'number'\n}","tryCatchPattern":"const testProc = spawn(cmd, args, { cwd: projectDir, env, stdio: 'inherit' })\ntestProc.once('error', (e) => { console.error('playwright spawn failed:', e.message) })\nif (!testProc.pid) throw new Error('Playwright did not return a PID')","preventionTips":["Validate projectDir resolves to the repo root with package.json.","Ensure pnpm/node are on PATH in the inherited env.","Attach an 'error' listener to spawn to capture ENOENT with context."],"tags":["playwright","spawn","e2e","test-runner"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}