doctor to find out why a dev session (or an automation verb talking to it) is not working.
doctor walks the control-channel legs of a dev session in dependency order (from the on-disk readiness contract all the way to a live probe of the in-extension executor) and names the first failing leg with a concrete fix, instead of the dead-end error each command gives on its own.
When to use doctor
extension logsor an act verb can’t connect and you want to know which leg is broken.- An agent or script drives a session via
ready.jsonand needs a machine-readable health check. - A dev session looks alive but the extension stopped responding.
Usage
Arguments and flags
How doctor picks the session
Without --browser, doctor diagnoses the session that exists, not a hardcoded default. It lists the ready contracts under dist/extension-js/ and resolves from there:
- Exactly one live contract wins outright.
- With several contracts,
chromiumwins when present, otherwise the first one alphabetically. Asession-resolutionwarn check then names every candidate before the numbered checks run. - With no contracts at all,
doctorfalls back tochromium.
What it checks
Checks run in dependency order. When a leg fails, later checks that depend on it are marked skip and name the check that blocked them: a skip is not a pass. A zerothsession-resolution check appears only when several live sessions exist. It warns and names the session that the run diagnoses.
Some legs have deliberate soft answers:
port-agreementpasses when no port file exists yet. A first session for this project and browser has nothing to disagree with.executorreports warn, not fail, within 10 seconds of a fresh compile. The service worker may still be attaching. Wait forruntime: "attached"inready.jsonbefore acting.browserreports skip when the contract has nocdpPortstamped and no exit recorded. Absence of exit evidence is not proof of a live browser.
✓ pass, ✗ fail, ! warn, – skip. The exit code is 0 when nothing failed and 1 when any check failed, so CI and scripts can gate on it directly.
Machine-readable output
--output json prints one schema-1 envelope. The check results ride in value on both verdicts, because an unhealthy report is still a report:
ok: true with status: "healthy" and error: null.
status on each check is pass, fail, warn, or skip. remediation is present on failures that have a known fix. The envelope’s error.code maps from the first failing check:
Typical flow
- Start a session:
extension dev --browser=chromium --allow-control(add--allow-evalfor the eval verb). - When a follow-up command can’t reach it, run
extension doctorfrom the same project root. - Apply the remediation printed for the first failing check, then re-run
doctorto confirm.
Next steps
- Read the readiness contract
doctorstarts from indev. - Stream extension logs from a healthy session with Debugging.
- Review shared flags in Global flags.

