Problem
Migrating from agent-level cli_backend to model-scoped runtime requires repeatable, plugin-extensible doctor rules so legacy configs are detected and rewritten safely.
Current state
- Legacy field
cli_backend in YAML and Python (praisonai/agents_generator.py, praisonai/agent.py, praisonaiagents/agent/agent.py).
- Doctor infrastructure in
praisonai/cli/commands/doctor.py without a DoctorContractProtocol for third-party migration rules.
- Deploy doctor helpers in
praisonai/deploy/doctor.py are deployment-focused, not agent runtime schema.
Proposed design
- Add
DoctorContractProtocol in praisonaiagents/runtime/doctor_protocol.py (or praisonaiagents/hooks/ if shared): collect_findings(config) -> list[Finding], apply_fix(config) -> config, rule_id.
- Core registers built-in rule: migrate
cli_backend → models.<default>.runtime with mapping table for known ids (claude-code → same runtime id).
- Plugins register additional rules via entry point
praisonai.doctor_contracts.
- Wire into
praisonai doctor runtime --fix (extends preflight issue).
Acceptance criteria
Layer
Primary: core (DoctorContractProtocol, built-in rule)
Secondary: wrapper (praisonai doctor runtime), plugins (custom rules)
3-way parity (Python / YAML / CLI)
| Surface |
Supported |
| Python |
yes — programmatic lint/fix API |
| YAML |
yes — primary migration target |
| CLI |
yes — praisonai doctor runtime --fix |
Priority
P2
Related modules
praisonai/cli/commands/doctor.py, praisonai/agents_generator.py, praisonaiagents/agent/agent.py, praisonaiagents/plugins/
Related issues
Problem
Migrating from agent-level
cli_backendto model-scoped runtime requires repeatable, plugin-extensible doctor rules so legacy configs are detected and rewritten safely.Current state
cli_backendin YAML and Python (praisonai/agents_generator.py,praisonai/agent.py,praisonaiagents/agent/agent.py).praisonai/cli/commands/doctor.pywithout aDoctorContractProtocolfor third-party migration rules.praisonai/deploy/doctor.pyare deployment-focused, not agent runtime schema.Proposed design
DoctorContractProtocolinpraisonaiagents/runtime/doctor_protocol.py(orpraisonaiagents/hooks/if shared):collect_findings(config) -> list[Finding],apply_fix(config) -> config,rule_id.cli_backend→models.<default>.runtimewith mapping table for known ids (claude-code→ same runtime id).praisonai.doctor_contracts.praisonai doctor runtime --fix(extends preflight issue).Acceptance criteria
--fixis idempotent and creates backup hint in doctor output.--fixflag.Layer
Primary: core (
DoctorContractProtocol, built-in rule)Secondary: wrapper (
praisonai doctor runtime), plugins (custom rules)3-way parity (Python / YAML / CLI)
praisonai doctor runtime --fixPriority
P2
Related modules
praisonai/cli/commands/doctor.py,praisonai/agents_generator.py,praisonaiagents/agent/agent.py,praisonaiagents/plugins/Related issues