Problem
When runtime: auto is set on a model, there is no principled way to pick among plugin harnesses that support a given provider/model pair. Users must hard-code runtime ids or rely on agent-level cli_backend.
Current state
- CLI backend registry in
praisonai/cli_backends/registry.py lists ids but does not score by supports(provider, model) or priority.
- Model router in
praisonaiagents/llm/ selects LLM endpoints without runtime harness matching.
- Entry points:
praisonai.cli_backends group; no parallel praisonai.runtimes auto-selection contract.
Proposed design
- Extend
AgentRuntimeProtocol with supports(provider: str, model: str) -> bool and optional selection_priority() -> int (lower = preferred), mirroring harness selection patterns used elsewhere in the wrapper registry.
auto resolution in model-scoped policy: filter registered runtimes by supports, sort by priority, fall back to praisonai default.
- Plugin packages (PraisonAI-Plugins) register runtimes via entry points with declared provider/model prefixes.
- Log chosen runtime id at debug level for observability.
Acceptance criteria
Layer
Primary: core (selection algorithm in praisonaiagents/runtime/resolve.py)
Secondary: plugins (harness registration), wrapper (entry point wiring)
3-way parity (Python / YAML / CLI)
| Surface |
Supported |
| Python |
yes |
| YAML |
yes — runtime: auto on model entries |
| CLI |
yes — inherits from agent run model config |
Priority
P2
Related modules
praisonaiagents/runtime/registry.py, praisonai/cli_backends/registry.py, praisonaiagents/llm/, praisonaiagents/plugins/
Related issues
Problem
When
runtime: autois set on a model, there is no principled way to pick among plugin harnesses that support a given provider/model pair. Users must hard-code runtime ids or rely on agent-levelcli_backend.Current state
praisonai/cli_backends/registry.pylists ids but does not score bysupports(provider, model)or priority.praisonaiagents/llm/selects LLM endpoints without runtime harness matching.praisonai.cli_backendsgroup; no parallelpraisonai.runtimesauto-selection contract.Proposed design
AgentRuntimeProtocolwithsupports(provider: str, model: str) -> booland optionalselection_priority() -> int(lower = preferred), mirroring harness selection patterns used elsewhere in the wrapper registry.autoresolution in model-scoped policy: filter registered runtimes bysupports, sort by priority, fall back topraisonaidefault.Acceptance criteria
autoselects highest-priority supporting runtime in unit tests with multiple registered harnesses.praisonaidocumented and tested.Layer
Primary: core (selection algorithm in
praisonaiagents/runtime/resolve.py)Secondary: plugins (harness registration), wrapper (entry point wiring)
3-way parity (Python / YAML / CLI)
runtime: autoon model entriesPriority
P2
Related modules
praisonaiagents/runtime/registry.py,praisonai/cli_backends/registry.py,praisonaiagents/llm/,praisonaiagents/plugins/Related issues