Skip to main content

Module doctor

Module doctor 

Source
Expand description

lev doctor - prove the provider wiring works, one layer at a time.

Four checks run in order and each one is reported, so a failure names the layer that broke instead of leaving the caller to guess:

  1. config - the config file parses and a provider registry can be built.
  2. resolve - the user’s defaults pick a provider that is actually registered. This is the check that catches a stage resolving to anthropic/claude-sonnet-4-6 (the hard-coded last resort in ModelConfig::provider) on a machine with no Anthropic key - the root cause of a fleet of runs that spawned, sat at iteration 0, and never took a turn.
  3. inference - one real call to that provider, straight through Provider::infer. No world, no run, nothing on disk.
  4. daemon - a throwaway one-stage agent spawned over the control socket and waited on, then deleted. This is the only check that exercises the handoff, which is why it is worth the second billed call: checks 1-3 passing while this one fails is exactly the “credentials are fine, the daemon is wedged” verdict that used to take a hand-built canary agent to establish.

The daemon-touching I/O lives behind crate::dispatch::RiskyExecutors, so the cores here are driven by unit tests against injected registries and a scripted control socket. The registry builder is a &dyn Fn rather than a generic for the coverage reason documented on crate::commands::models’s equivalent seam.

Structs§

Check
One layer’s verdict, with whatever detail makes it actionable.
DoctorArgs
Arguments for lev doctor.

Enums§

CheckStatus
Whether a check proved what it set out to prove.
DaemonTarget
What the fourth check has to work with.

Constants§

DOCTOR_LONG_ABOUT
lev doctor --help. What each check proves, and what a failure at it means.

Functions§

execute
lev doctor. The binary decides what the fourth check gets to talk to; see DaemonTarget.
format_report
Render the checks as the table lev doctor prints.
run_checks
Run the checks in order, stopping at the first failure.