ruflo v3.38.8

v3.38.8

v3.38.8 — provider/model config propagation fix (#2962)

Changed 5
  • determineAgentModel() treats any non-alias config.model string as an explicit selection via the modelId fast-path
  • agent_spawn forwards config.provider into the stored agent record for unambiguous explicit choices (ollama/openrouter)
  • callAnthropicMessages() now consults persisted agents.providers config for baseUrl/apiKey/model when env vars are absent
  • executeAgentTask() forwards the agent's explicit provider into the first dispatch call
  • provider/model resolution now follows precedence: explicit per-agent flag → env vars → persisted agents.providers config → key-presence inference
Fixed 1
  • explicit provider/model config now propagates into agent execution instead of silently falling back to env vars or defaults
Highlights
  • fix(agent): explicit provider/model config now propagates into agent execution (#2962, PR #3007)

providers configure and agent spawn --provider/--model previously persisted user intent but the execution path (callAnthropicMessages, executeAgentTask, determineAgentModel) only ever consulted env vars and a fixed 5-alias model list — silently discarding both. A user who configured local Ollama or OpenRouter would see two successful CLI commands, then execution would either fail closed or silently use a different provider/model than requested.

  • determineAgentModel() now treats any non-alias config.model string (e.g. an Ollama tag) as an explicit selection via the existing modelId fast-path, instead of falling through to task-based routing / agent-type defaults.
  • agent_spawn forwards config.provider into the stored (and returned) agent record when it's an unambiguous explicit choice (ollama/openrouter; anthropic is excluded since the CLI silently defaults to it when --provider isn't passed).
  • callAnthropicMessages() now consults the persisted agents.providers config for baseUrl/apiKey/model when env vars are absent. A self-hosted, unauthenticated Ollama endpoint no longer requires the undocumented OLLAMA_API_KEY=local sentinel.
  • executeAgentTask() forwards the agent's explicit provider into the first dispatch call.

Precedence (resolving the open design question from the issue thread, credit @pacphi): explicit per-agent flag → env vars → persisted agents.providers config → key-presence inference (unchanged, last resort).

Regression coverage: v3/@claude-flow/cli/__tests__/agent-provider-model-propagation.test.ts (3 tests, each verified to fail against the pre-fix code and pass against the fix).

Verification
  • TypeScript clean (tsc --noEmit)
  • 202/209 existing tests green for touched files (7 pre-existing unrelated failures confirmed present on unpatched main too — stale fs mock in mcp-tools-deep.test.ts)
  • CI: 107 checks passed, 3 skipped (conditional), 0 failed
  • Tarball-verified: fix present in the published @claude-flow/cli@3.38.8 package
View original

Upgraded? How did it go?

Discussion