resolve
AI Agent Turn-time runtime resolution API for handoffs and sub-agents. This module addresses the issue where handoffs and sub-agents inherit construction-time runtime pins from the parent agent, causing wrong harness execution when the delegate uses a different model_ref or provider. The solution provides turn-time resolution that re-resolves runtime from (agent_id, model_ref) at each handoff/sub-agent invocation.Import
Classes
RuntimeProtocol
Protocol for agent runtime implementations.
AgentRuntimeProtocol
Extended protocol for agent-specific runtime features.
SessionContext
Context for runtime resolution within a session.
RuntimeResolver
Abstract base class for runtime resolution strategies.
DefaultRuntimeResolver
Default runtime resolver that creates appropriate runtime instances.
LLMRuntimeWrapper
Wrapper around existing LLM class to provide runtime protocol.
FallbackRuntime
Fallback runtime implementation that raises errors instead of returning stubs.
Functions
set_global_resolver()
Set the global runtime resolver.
get_global_resolver()
Get the global runtime resolver, creating default if needed.
resolve_runtime()
Resolve runtime for the given agent and model at turn-time.
get_runtime_cache()
Get a copy of the current runtime cache (for debugging/testing).
clear_runtime_cache()
Clear runtime cache for a specific session or all sessions.

