fix(strategize): propagate actor options (openai_api_base, openai_api_key) to LLM client creation in Strategize/Execute paths #11257

Merged
HAL9000 merged 4 commits from bugfix/m5-actor-options-ignored into master 2026-05-29 00:09:42 +00:00

4 Commits

Author SHA1 Message Date
controller-ci-rerun 8cace12f66 chore: re-trigger CI [controller]
CI / push-validation (pull_request) Successful in 27s
CI / helm (pull_request) Successful in 29s
CI / lint (pull_request) Successful in 38s
CI / build (pull_request) Successful in 49s
CI / quality (pull_request) Successful in 1m1s
CI / typecheck (pull_request) Successful in 1m21s
CI / security (pull_request) Successful in 1m22s
CI / integration_tests (pull_request) Successful in 4m11s
CI / unit_tests (pull_request) Successful in 4m27s
CI / docker (pull_request) Successful in 1m24s
CI / coverage (pull_request) Successful in 13m0s
CI / status-check (pull_request) Successful in 4s
2026-05-28 19:35:32 -04:00
HAL9000 fae4384370 fix(actor): top-level config keys take precedence over options block duplicates
CI / push-validation (pull_request) Successful in 31s
CI / lint (pull_request) Successful in 34s
CI / quality (pull_request) Successful in 47s
CI / helm (pull_request) Successful in 47s
CI / build (pull_request) Successful in 53s
CI / typecheck (pull_request) Successful in 1m2s
CI / security (pull_request) Successful in 1m2s
CI / integration_tests (pull_request) Successful in 2m49s
CI / unit_tests (pull_request) Successful in 6m36s
CI / docker (pull_request) Failing after 15m28s
CI / coverage (pull_request) Failing after 15m28s
CI / status-check (pull_request) Has been cancelled
In both ToolCallingLLMCaller._resolve_llm and SimpleLLMAgent._resolve_llm,
the options block was merged after top-level keys were applied, causing
llm_kwargs.update(...) to overwrite top-level temperature/max_tokens/
max_retries with any duplicate values from the options block.

Fix: apply build_llm_kwargs_from_options first, then re-apply the
top-level extracted values so they always win.

ISSUES CLOSED: #11243 #11223
2026-05-28 17:35:08 -04:00
HAL9000 2dd920078a fix(tests): add resolve_actor_options to mock lifecycle helpers
The PR added resolve_actor_options() to StrategyActor, LLMStrategizeActor,
and LLMExecuteActor, but the three mock lifecycle SimpleNamespace objects
used by tests did not include this method, causing AttributeError at
runtime:

- features/mocks/mock_strategy_llm.py: make_mock_lifecycle() used by
  robot/helper_strategy_actor.py (strategy_actor.robot llm-json test)
  and features/steps/strategy_actor_llm_steps.py
- features/steps/llm_actors_coverage_steps.py: _make_mock_lifecycle()
  used by llm_actors_coverage.feature scenarios
- robot/helper_m5_e2e_context.py: inline lifecycle SimpleNamespace
  used by m5_e2e_verification.robot Execute Phase LLM Uses ACMS Context

All three now include resolve_actor_options=MagicMock(return_value=None)
matching the None-return contract the actors use when no custom backend
is configured.

ISSUES CLOSED: #11256
2026-05-28 17:35:08 -04:00
CoreRasurae d5fd6b1765 fix(strategize): propagate actor options.openai_api_base and options.openai_api_key to LLM client creation in Strategize/Execute paths
Extract shared build_llm_kwargs_from_options() utility in actor/config.py
that converts actor-level YAML options (openai_api_base, openai_api_key,
temperature, max_tokens, etc.) into kwargs for ProviderRegistry.create_llm().

Add options field to ActorConfigSchema so it survives Pydantic validation
instead of being silently dropped by extra='ignore' default.

Add resolve_actor_options() to PlanLifecycleService and both LifecycleService
and PlanLifecycleProtocol protocols so every call site can retrieve the
actor's config_blob.options dict.

Fix the four call sites that previously called create_llm() with zero extra
kwargs, preventing local/custom LLM backends from working:

- StrategyActor._execute_with_llm() in strategy_actor.py
- LLMStrategizeActor.execute() in llm_actors.py
- LLMExecuteActor.execute() in llm_actors.py
- SessionWorkflow._resolve_llm() in session_workflow.py

Refactor reactive path (stream_router.py, tool_caller.py) to use the
shared build_llm_kwargs_from_options() utility instead of inline copies.

Wire actor_options_resolver through CLI session builder and A2A facade.

ISSUES CLOSED: #11256
2026-05-28 17:35:08 -04:00