Skip to content

Engine Anthropic model lookup calls an undefined helper, always silently falls back to curated list #390

Description

@TonsOfFun

Part of an ActiveAgent + actionagent dashboard functional review (multi-agent, adversarially verified). Severity: 🟠 Major.

ProviderModelsController#live_anthropic_models calls current_user_provider_key("anthropic"), but the engine only defines owner_provider_key (the extraction renamed the helper and updated the Ollama call site but not the Anthropic one). Every live Anthropic model lookup raises NameError internally and silently returns the curated fallback list.

Findings

Engine live Anthropic model lookup calls undefined helper current_user_provider_key, so it always silently falls back to curated

  • Where: actionagent/app/controllers/action_agent/api/provider_models_controller.rb:77 · severity: major · kind: drift · repo: activeagent
  • What breaks: In the engine, ProviderModelsController#live_anthropic_models calls current_user_provider_key("anthropic") but the engine copy only defines owner_provider_key (the extraction renamed the helper and updated the ollama call site but not the anthropic one; the app copy still defines current_user_provider_key at app/controllers/api/provider_models_controller.rb:56-61). The call raises NoMethodError on every request for provider=anthropic, which the method's own rescue StandardError swallows into a log warning, so the endpoint always returns the curated list and the advertised behavior — 'new model releases appear without a deploy' via the account's Anthropic key — can never work in the engine, even with a key configured. Engine is behind the app; the fix is to change line 77 to owner_provider_key("anthropic") (matching how ollama_host at line 53 uses owner_provider_key).
  • Evidence: Code: actionagent/app/controllers/action_agent/api/provider_models_controller.rb:77 (key = current_user_provider_key("anthropic")&.credential) vs :58 (only owner_provider_key defined); grep over the whole engine finds no definition of current_user_provider_key. App sibling defines it (activeagents app/controllers/api/provider_models_controller.rb:56-61). Live proof: curl --noproxy localhost http://localhost:3001/activeagents/api/provider_models?provider=anthropic returns {"source":"curated"} and /home/user/activeagent/test/dummy/log/development.log line 4636 records: [ProviderModels] anthropic lookup failed: undefined method 'current_user_provider_key' for an instance of ActionAgent::Api::ProviderModelsController.
  • Suggested fix: In actionagent/app/controllers/action_agent/api/provider_models_controller.rb:77 change key = current_user_provider_key("anthropic")&.credential to key = owner_provider_key("anthropic")&.credential, matching the owner-scoped helper already used by ollama_host at line 53. Optionally add an engine test that stubs the Anthropic Models API and asserts source == "live" when an anthropic ProviderKey exists, to catch this class of rescue-swallowed regression.

Verification

Each finding above was produced by a dedicated per-feature review agent, then confirmed by an independent adversarial verifier (all rated high-confidence; zero rejected in this set). File:line citations are against the current main/HEAD of each repo; many were reproduced live against a booted dashboard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions