{"record":{"id":"4656d7e951486cb1","repo":"Yeachan-Heo/oh-my-codex","slug":"ask-failed-to-launch-advisor-script-child-err","errorCode":null,"errorMessage":"[ask] failed to launch advisor script: ${child.error.message}","messagePattern":"\\[ask\\] failed to launch advisor script: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/cli/ask.ts","lineNumber":211,"sourceCode":"    {\n      cwd: process.cwd(),\n      env: {\n        ...process.env,\n        [ASK_ORIGINAL_TASK_ENV]: parsed.prompt,\n      },\n      stdio: ['ignore', 'pipe', 'pipe'],\n    },\n  );\n\n  if (child.stdout && child.stdout.length > 0) {\n    process.stdout.write(child.stdout);\n  }\n  if (child.stderr && child.stderr.length > 0) {\n    process.stderr.write(child.stderr);\n  }\n\n  if (child.error) {\n    throw new Error(`[ask] failed to launch advisor script: ${child.error.message}`);\n  }\n\n  const status = typeof child.status === 'number'\n    ? child.status\n    : resolveSignalExitCode(child.signal);\n\n  if (status !== 0) {\n    process.exitCode = status;\n  }\n}\n","sourceCodeStart":193,"sourceCodeEnd":222,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/ask.ts#L193-L222","documentation":"After running the advisor script synchronously, `omx ask` inspects the child result. If `child.error` is set, the script process never launched successfully (spawn-level failure, not a non-zero exit) and the raw error message is surfaced. This is the same family as spawn ENOENT/EACCES but for the advisor script specifically.","triggerScenarios":"The advisor script file was deleted between the existsSync check and spawn, its Node interpreter or shebang is unavailable, or OS permissions/sandboxing block execution.","commonSituations":"AVIF/AV software locking or removing the script; node not on PATH for the spawn context in containers; noexec mounts; race with package upgrades replacing dist files mid-run.","solutions":["Read the appended message: ENOENT → script vanished (reinstall); EACCES → chmod +x or fix permissions; otherwise address the OS error","Reinstall the package to restore a consistent dist tree","Ensure `node` is resolvable in the environment where omx runs","Retry once — existsSync-then-spawn races are transient during concurrent upgrades"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import { existsSync } from 'node:fs';\nif (!existsSync(advisorScriptPath)) throw new Error('advisor script vanished; reinstall omx');","typeGuard":null,"tryCatchPattern":"catch (e) { if (/failed to launch advisor script/.test(String(e))) { await reinstallOmx(); retry(); } else throw e; }","preventionTips":["Ensure node is on PATH in the spawn environment","Avoid upgrading omx while ask commands run","Exclude tool dirs from AV scanning"],"tags":["ask","spawn","advisor-script","installation"],"backgroundTag":"spawn-failure","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}