fix(reactive): forward actor options block to LLM constructor for custom backend support #11225

Merged
hurui200320 merged 1 commits from bugfix/m5-actor-options-forwarding into master 2026-05-16 13:39:13 +00:00

1 Commits

Author SHA1 Message Date
hurui200320 25a7516d3f fix(reactive): forward actor options block to LLM constructor for custom backend support
CI / lint (pull_request) Successful in 1m19s
CI / typecheck (pull_request) Successful in 1m35s
CI / quality (pull_request) Successful in 1m19s
CI / security (pull_request) Successful in 1m39s
CI / helm (pull_request) Successful in 27s
CI / push-validation (pull_request) Successful in 37s
CI / build (pull_request) Successful in 36s
CI / integration_tests (pull_request) Successful in 4m14s
CI / unit_tests (pull_request) Successful in 4m29s
CI / docker (pull_request) Successful in 1m59s
CI / coverage (pull_request) Successful in 13m4s
CI / status-check (pull_request) Successful in 7s
Two code paths in the reactive actor run pipeline silently discarded the
options: block from v3 actor YAML, preventing custom OpenAI-compatible
backends (llama.cpp, Ollama, etc.) from being used.

Review fixes applied:

- Fix 1: Relabeled issue #11223 from Type/Task to Type/Bug; added
  @tdd_issue/@tdd_issue_11223 tags to all 5 Behave scenarios.
- Fix 2: openai_api_key in options now routes through the registry's
  __api_key_sentinel mechanism so user-provided keys correctly override
  environment defaults. (stream_router.py)
- Fix 3: type: graph actors now propagate actor-level options to
  individual node configs via setdefault. (config_parser.py)
- Fix 4: Options keys are validated against an explicit allowlist;
  reserved keys (provider_type, model_id) are excluded; unrecognized
  keys log a WARNING instead of being silently forwarded. (stream_router.py)
- Fix 5: Updated _build_from_v3 docstring to list options as a
  propagated field. (config_parser.py)
- Fix 6: Removed inconsistent and options_raw emptiness guard; empty
  options dicts are now preserved consistently. (config_parser.py)
- Fix 7: Reserved keys provider_type and model_id are excluded from
  the options merge loop to prevent TypeError. (stream_router.py)
- Fix 8: Added Behave scenario verifying top-level temperature takes
  precedence over options duplicate. (consolidated_routing.feature + steps)
- Fix 9: Strengthened "no extra kwargs" assertion to assert kwargs == {}
  directly instead of using an allow-list filter. (stream_router steps)
- Fix 10: Strengthened options assertion to exact dict equality.
  (actor_v3_schema_extended_steps.py)
- N1: Comment style aligned to M5: prefix convention.
- N2: Type annotations changed from Any to Context (behave.runner).
- N3: Added Behave scenario for empty options: {} dict behavior.

Tests: 5 new Behave scenarios (3 in actor_v3_schema.feature, 2 in
consolidated_routing.feature) with @tdd_issue/@tdd_issue_11223 tags.

ISSUES CLOSED: #11223
2026-05-15 12:16:30 +00:00