Skip to content

Step summarizer, memory chunking and Flash operator fallback hardcode the Google provider, bypassing artemis.jsonc #95

Description

@jovinus302

Summary

Several runtime code paths instantiate a Google LLM directly via get_google_llm() instead of resolving the provider configured in config/artemis.jsonc. As a result, configuring a non-Google provider for every node (e.g. "provider": "openai" pointed at an OpenAI-compatible gateway, or "provider": "anthropic") is not sufficient to run a Flash task: the run still tries to construct ChatGoogleGenerativeAI and aborts when no Google API key is present.

The README advertises Gemini, Claude and GPT-4o support, and ModelFactory / get_llm(ctx, name=...) already handle provider selection correctly, so this looks like a handful of call sites that bypass the router rather than a design limitation.

Related: #41 (unit tests requiring Gemini credentials) is a sibling symptom on the test side.

Affected code (at 371aa6d)

File Line What it does
artemis/agents/flash/summarizer.py 169, 173 VisualStepSummarizer calls get_google_llm(model_name=target_model, ...) whenever a summarizer model name is configured, and again in the except fallback. Setting agent.flash.step_summarizer.model therefore forces the Google provider regardless of the rest of the config.
artemis/memory/chunking.py 328, 335 StepCapsuleLens._get_llm() / _get_fallback_llm() always call get_google_llm(...) for agent.memory.chunking.model and its fallback.
artemis/agents/flash/runner.py 287 Operator LLM fallback (when get_llm(ctx, name="operator") raises) is hardcoded to get_google_llm(model_name="gemini-2.5-flash").
artemis/config/llm.py 120-131 lightweight_judge_default() (pixel safety net / planner validation judges) hardcodes provider="google", and there is no artemis.jsonc key to override the judge provider.

StepSummarizerConfig and MemoryChunkingConfig (artemis/config/agent.py) only carry a model name and no provider, which is probably why those call sites assume Google.

Steps to reproduce

  1. In config/artemis.jsonc, set default, every entry under nodes, agent.flash.step_summarizer and agent.memory.chunking to a non-Google provider, e.g. "provider": "openai" with OPENAI_API_KEY / OPENAI_BASE_URL pointing at an OpenAI-compatible endpoint.
  2. Leave GEMINI_API_KEY and GOOGLE_API_KEY unset.
  3. Run any Flash task, e.g. uv run artemis run "Open the Settings app" (or mobile_run_task through the MCP server).

Observed: the task fails while constructing ChatGoogleGenerativeAI (no API key) from the step summarizer / memory chunking / operator fallback paths, even though no node is configured to use Google.

Expected: no Google client is created when no node is configured for Google; the configured provider is honored everywhere.

Suggested fix

  • Replace the direct get_google_llm() calls in summarizer.py, chunking.py and runner.py with provider-aware resolution: either get_llm(ctx, name=...) against a named node, or ModelFactory.create_model(ModelEndpoint(provider=<configured default provider>, model=...)).
  • Add an optional provider field to StepSummarizerConfig and MemoryChunkingConfig, defaulting to the default node's provider when omitted.
  • Let lightweight_judge_default() inherit the configured default provider (or expose a judge override in artemis.jsonc).

Workaround

Locally re-pointing the five call sites to the OpenAI factory and setting every node to provider: "openai" makes Flash tasks complete end-to-end with zero Google calls (verified on a physical Android device), so the rest of the pipeline is already provider-agnostic.

I have a fix along the lines above and will open a PR referencing this issue.

Environment

  • ARTEMIS main @ 371aa6d (2026-09-11)
  • Python 3.12, Windows 11, uv sync install

Activity

  1. added a commit that references this issue on Sep 15, 2026
    724f823
  2. coygeek commented on Oct 25, 2026

    @coygeek

    A current-source constructor-only check adds an OpenRouter case, an agent-versus-utility control, and a startup bypass that needs no source patch.

    Baseline: default-branch source 351ca8422f7b5b54e80a9c1ce03a222e02415b6b (project metadata 1.0; no repository release or tag), Python 3.12.15, langchain-google-genai 4.3.4, langchain-core 1.5.6, langchain-openai 1.5.2, pydantic 2.13.4. Dependencies were reused read-only after matching the fresh checkout's lockfile and manifest; source imports resolved to that checkout.

    For the narrow empty-model path, I set default and all existing nodes and presets to OpenRouter, with nvidia/nemotron-3.5-super-vl:free for both primary and fallback, then set:

    {"agent": {"flash": {"step_summarizer": {"enabled": true, "model": ""}}}}

    With only a synthetic constructor token for OpenRouter and no Google/Gemini/GCP credentials, I initialized the real ArtemisContext with an unentered DeviceContext(device_id="synthetic-unentered-device"). No genuine key or device is needed for these constructor checks. Results:

    initialize_llm_config(): passed
    get_llm(ctx, name="summarizer"): constructed OpenRouter client
    get_llm(ctx, name="summarizer", is_utils=True):
      AttributeError: 'LLMConfigUtils' object has no attribute 'summarizer'
    FlashRunner(ctx, goal="Constructor probe; never executed"), enabled=true:
      ValidationError for ChatGoogleGenerativeAI
      API key required for Gemini Developer API
    same config, changing only enabled=false:
      runner constructed; runner.summarizer is None
      runner._init_llm().endpoint.provider.value == "openrouter"
    

    The empty-model branch in artemis/agents/flash/summarizer.py:164-173 calls get_llm(..., name="summarizer", is_utils=True) and catches the lookup failure by retrying through Google. summarizer is an agent field in artemis/config/llm.py:75-89, absent from LLMConfigUtils. This distinguishes a failed configured-agent lookup from an unchanged Gemini auxiliary model requiring its own key. The branch is also the narrow scope of the currently unmerged PR #141.

    A second constructor case with the auxiliary model explicitly set to the same OpenRouter model ID also failed with the missing-Google-key error. The shipped nonempty Gemini auxiliary defaults are separate model choices, so these observations should not be read as proof that changing only the primary provider must rewrite those defaults.

    Disabling the optional step summarizer is a verified construction-only bypass here. Socket connections and process launches were blocked and counted: zero attempts for each. The device context was never entered, no runner/model invocation occurred, and this does not verify generated summaries, Pro task execution, or long-history compression. Pro's visual path shares this constructor; history capsules have a separate model/fallback path and need a distinct execution check.

  3. added 3 commits that reference this issue on Nov 9, 2026
    a55e779
    d18acfa
    7729d52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions