Skip to main content
praisonai doctor runtime detects legacy cli_backend fields in your agent YAML and migrates them to the new models.default.runtime field.
The shortest command for this migration is now praisonai doctor fix --execute (added in PraisonAI 4.6.108+). It runs the same migration logic as praisonai doctor runtime --fix --execute but with a simpler flag shape. Both remain supported — see the Doctor CLI setup auto-fix section for the flag comparison.
The user runs praisonai doctor runtime; the scan finds legacy cli_backend fields and migrates them to model-scoped runtime config.

Quick Start

1

Scan only

Run a scan to detect legacy configuration without making any changes:
Output:
2

Preview fix (dry-run)

Preview what changes will be made before applying them:
Output:
3

Apply fix with backup

Apply the migration and create a timestamped backup:
A backup is created at agents.backup.20240115_143022.yaml alongside your original file.
4

Shorter equivalent: doctor fix

The doctor fix subcommand runs the same migration with a simpler flag shape:
The backup file format differs between the two commands:
  • doctor fix creates agents.yaml.bak
  • doctor runtime --fix --execute creates agents.backup.<YYYYMMDD_HHMMSS>.yaml
5

Target a specific file


What Gets Migrated

The cli_backend field at the top level and inside roles.<role_name> is migrated to models.default.runtime.
Known backend ID mapping:

How It Works


Flags Reference

doctor fix flag equivalents — use either command; they share the same migration logic: doctor runtime flags: Behavior summary:
  • Without --fix: Reports WARN with count of legacy configs found.
  • With --fix (dry-run): Shows a preview diff; suggests --fix --execute.
  • With --fix --execute: Writes migrated YAML and leaves a <stem>.backup.<YYYYMMDD_HHMMSS>.yaml backup.
  • If --file is specified but file does not exist: ERROR, severity HIGH.
  • If no config file is found: SKIP.

Writing a Custom Rule

Implement DoctorContractProtocol to add your own migration rules:

Plugin Registration via Entry Point

For distribution as a package, register via the praisonai.doctor_contracts entry-point group:
Plugins registered this way are auto-discovered when get_rules() is called — no manual register_rule() needed.

Finding Dataclass


Programmatic API


Best Practices

Run praisonai doctor runtime --fix (default dry-run) before --execute. Verify the diff is what you expect — especially for complex YAML with deeply nested roles.
Even though --execute creates a backup, commit or stage your agents.yaml in version control before migrating. This gives you a clean diff to review in your VCS history.
The .backup.<timestamp>.yaml file is left next to the migrated file. Delete it once you’ve confirmed the migrated config works as expected.
Use pyproject.toml entry-points rather than register_rule() in application code. Entry-point rules are discoverable by any consumer of the praisonaiagents.runtime package without requiring code changes.

Doctor CLI

Full reference for praisonai doctor health checks and subcommands

CLI Backend Protocol

The cli_backend field and CLI backend registration system

Optional Dependencies Check

How praisonai doctor env —deep probes optional packages with broken/slow buckets