Feature: Runtime Executor Extended Coverage As a developer I want the runtime executor to handle additional edge cases in graph, tool, and multi-actor execution So that all code paths in the runtime module are exercised Background: Given the runtime extended test context is initialized (rxe) Scenario: execute detects graph type from routes key in CleverAgents v2.0 format Given a config dict with routes key but no type field (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test v2 graph" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _normalize_graph_config handles v2.0 routes with dict nodes Given a config dict with type graph and v2.0 routes format with dict nodes (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test v2 dict nodes" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _normalize_graph_config handles v2.0 routes with list nodes Given a config dict with type graph and v2.0 routes format with list nodes (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test v2 list nodes" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _execute_llm builds conversation history from messages Given a config dict with type llm provider model and system_prompt in config block (rxe) And credentials dict with openai provider (rxe) And conversation history messages are provided (rxe) When I execute the extended runtime actor with message "test conversation" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _execute_llm picks up provider from config block when not at top level Given a config dict with type llm and provider model in nested config block (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test config block" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _execute_graph handles agent name from node ID in v2.0 actors block Given a config dict with type graph and v2.0 routes with actors block (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test agents block" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _execute_graph raises ConfigurationError for unexpected agent creation failure Given a config dict with type graph and route with agents block having missing agent (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test missing agent" (rxe) Then a ConfigurationError should be raised about agent creation failure (rxe) Scenario: _execute_graph merges global context from config with conversation history Given a config dict with type graph and route with global context (rxe) And credentials dict with openai provider (rxe) And conversation history messages are provided (rxe) When I execute the extended runtime actor with message "test global context" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _execute_tool builds conversation history from messages Given a config dict with type tool and tools list (rxe) And credentials dict with openai provider (rxe) And conversation history messages are provided (rxe) When I execute the extended runtime actor with message "test tool with history" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _execute_multi_actor uses default actor from cleveragents block Given a multi-actor config dict with cleveragents default_actor (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test default actor" (rxe) Then the execution should return an ActorResult (rxe) And the node usage IDs should be prefixed with the default actor name (rxe) Scenario: _execute_graph handles actor context without global key Given a config dict with type graph and route with actor context without global key (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test actor context" (rxe) Then the execution should return an ActorResult (rxe) Scenario: _execute_graph handles missing credential provider gracefully Given a config dict with type llm and unknown provider (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test missing creds" (rxe) Then a ConfigurationError should be raised about missing credentials (rxe) # --------------------------------------------------------------------------- # M3: parallel_execution override for legacy route format # --------------------------------------------------------------------------- Scenario: _execute_graph passes parallel_execution=False to PureGraphConfig for legacy route Given a config dict with type graph and route with parallel_execution false (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor and capture PureGraphConfig args (rxe) Then PureGraphConfig should have received parallel_execution=False (rxe) # --------------------------------------------------------------------------- # M4: conversation history forwarding verified by call_args assertion # --------------------------------------------------------------------------- Scenario: _execute_llm forwards conversation history to LLMAgent.process_message Given a config dict with type llm provider model and system_prompt in config block (rxe) And credentials dict with openai provider (rxe) And conversation history messages are provided (rxe) When I execute the LLM actor and capture process_message call args (rxe) Then process_message should have received conversation_history in context (rxe) # --------------------------------------------------------------------------- # m5: AC7 immutability for multi-actor path # --------------------------------------------------------------------------- Scenario: _execute_multi_actor does not mutate the stored config_dict (AC7) Given a multi-actor config dict with cleveragents default_actor (rxe) And credentials dict with openai provider (rxe) When I execute the extended runtime actor with message "test ac7 multi" (rxe) Then the multi-actor config_dict should be unchanged after execution (rxe)