| 68 | } |
| 69 | |
| 70 | async function dispatchDoctor(adapter: HarnessAdapter, options: RunDoctorOptions): Promise<number> { |
| 71 | switch (adapter.kind) { |
| 72 | // v22 backfill flags are handled once in runDoctor (shared DB), so the |
| 73 | // per-harness doctors below are NOT forwarded them — that's what |
| 74 | // prevented the doubled-output bug when both harnesses are installed. |
| 75 | case "opencode": { |
| 76 | return runOpenCodeDoctor({ |
| 77 | force: options.force, |
| 78 | issue: options.issue, |
| 79 | }); |
| 80 | } |
| 81 | case "pi": { |
| 82 | const piArgs: string[] = []; |
| 83 | if (options.force) piArgs.push("--force"); |
| 84 | if (options.issue) piArgs.push("--issue"); |
| 85 | return runPiDoctor(piArgs); |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Interactive cache-clear flow. Presents one combined picker showing |