{"record":{"id":"abf77177f318893a","repo":"coleam00/Archon","slug":"detached-workflow-process-tree-string-pid-is-s","errorCode":null,"errorMessage":"Detached workflow process tree ${String(pid)} is still running${killFailure ? `: ${killFailure.message}` : ''}","messagePattern":"Detached workflow process tree (.+?) is still running(.+?)` : ''\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/utils/detached-run-control.ts","lineNumber":537,"sourceCode":"    //\n    // A walk that never finished is a different case and is rethrown here. The root\n    // check can only stand in for the whole tree when every descendant was visited,\n    // and a `timeout` kill leaves taskkill part-way through: the root can be gone\n    // while a descendant the walk never reached is still alive. `/T` is what takes\n    // the descendants with the root, and that they actually die is proved by the\n    // descendant-leak case in the integration spec, not by any exit code.\n    let killFailure: Error | undefined;\n    try {\n      await execFileAsync('taskkill', ['/PID', String(pid), '/T', '/F'], {\n        timeout: TERMINATION_GRACE_MS,\n        windowsHide: true,\n      });\n    } catch (error) {\n      if (commandTerminatedBySignal(error)) throw error;\n      killFailure = error instanceof Error ? error : new Error(String(error));\n    }\n    if (!(await waitUntilGone(() => processExists(pid), TERMINATION_CONFIRM_MS))) {\n      throw new Error(\n        `Detached workflow process tree ${String(pid)} is still running` +\n          (killFailure ? `: ${killFailure.message}` : '')\n      );\n    }\n    return;\n  }\n\n  try {\n    process.kill(-pid, 'SIGTERM');\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code !== 'ESRCH') throw error;\n    if (processExists(pid)) {\n      throw new Error(\n        `Detached workflow owner ${String(pid)} is alive but does not own process group ${String(pid)}`\n      );\n    }\n    return;\n  }","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/utils/detached-run-control.ts#L519-L555","documentation":"Error \"Detached workflow process tree ${String(pid)} is still running${killFailure ? `: ${killFailure.message}` : ''}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/cli/src/utils/detached-run-control.ts:537 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}