Skip to content

VisualStepSummarizer hardcodes Google provider, breaking non-Gemini models in flash.step_summarizer.model (404 Not Found) #167

Open

Description

@kypeli

Description

The Flash step summarizer's model config field only works with Gemini models. Any other model ID — e.g. a TensorX/OpenRouter/custom-endpoint model like tensorx/deepseek/deepseek-v4-flash — is sent verbatim to Google's Generative Language API, which returns 404 Not
Found.

Steps to reproduce

  1. Set a non-Gemini model in config/artemis.jsonc:
"flash": {
  "step_summarizer": {
    "enabled": true,
    "model": "tensorx/deepseek/deepseek-v4-flash"
  }
}
  1. Run any Flash-profile task.
  2. Observe the per-step error in the logs:
    VisualStepSummarizer: Error generating summary for step 1: Error calling model 'tensorx/deepseek/deepseek-v4-flash' (Not Found): 404 Not Found. {'message': '', 'status': 'Not Found'}

Expected behavior

The model string should be routed through the provider resolution used everywhere else (via ModelProvider.from_string / the node's inherited provider), so non-Google models go to the correct endpoint (e.g. the OpenAI-compatible custom provider with OPENAI_BASE_URL).

Actual behavior

Every step summary fails immediately. Because HTTP 404 is classified BAD_REQUEST (non-retryable, no fallback), there is no recovery — summaries are permanently lost for the whole session.

Root cause

In artemis/agents/flash/summarizer.py (VisualStepSummarizer.init, ~lines 164–173):

if model_name:
    self._llm = get_google_llm(model_name=target_model, temperature=0.0)
else:
    self._llm = get_llm(ctx, name="summarizer", is_utils=True)

Whenever an explicit model_name is configured, the LLM is unconditionally built via get_google_llm() (artemis/services/llm.py), which hardcodes provider=ModelProvider.GOOGLE. The provider is never resolved from config, so the model ID is passed to ChatGoogleGenerativeAI as if it were a Gemini model name. Google's API has no such model → 404, surfaced by langchain_google_genai/chat_models.py:176.

Suggested fix

Route explicit model strings through provider resolution instead of hardcoding Google:

  • Add an optional provider field to the flash.step_summarizer and memory.chunking config blocks (defaulting to the global default.provider), and build these models through ModelFactory with the resolved ModelProvider.
  • Alternatively/additionally, infer the provider from the model string: treat provider/model-style prefixes or known non-Gemini IDs as OpenAI-compatible (custom endpoint), keeping bare gemini-* names on Google.
  • Guard the fallback path: if provider resolution fails, log a clear config error rather than silently retrying via get_google_llm.

Environment

  • Config: provider: "custom" default with OPENAI_BASE_URL=<3rd party LLM provider>

Activity

  1. kypeli commented on Oct 4, 2026

    @kypeli
    Author

    This issue is resolved by #168

  2. still-dream commented on Oct 28, 2026

    @still-dream

    Adding data points from latest main (commit 351ca84, Sep 28, 2026) — the hardcoded paths are still there, and PR #168 (open since Oct 4) has not been merged yet. Related: #179 (closed Oct 20), #138, #95.

    We hit this with an OpenAI-compatible endpoint (Zhipu BigModel, OPENAI_BASE_URL=https://open.bigmodel.cn/api/coding/paas/v4, model GLM-5.3-FLASH, no Google credentials configured), Flash profile:

    Error running automation: 1 validation error for ChatGoogleGenerativeAI
    Value error, API key required for Gemini Developer API. Provide api_key parameter or set
    GOOGLE_API_KEY/GEMINI_API_KEY environment variable.
    [type=value_error, input_value={'model': 'GLM-5.3-FLASH'..., 'google_api_key': ''}]
    

    Two extra data points beyond the 404 in the issue description:

    1. With no GOOGLE_API_KEY at all, this is worse than lost summaries — ChatGoogleGenerativeAI fails pydantic validation at construction time inside FlashRunner.__init__, so the entire task crashes ~6s in (right after Device environment is ready) with 0 steps executed. Same failure signature as Flash profile still initializes Gemini clients when a non-Google default model is configured #179.

    2. A config-only workaround is impossible. StepSummarizerConfig.model has a field default (gemini-2.5-flash-lite), so model_name is always truthy and the get_google_llm() branch is always taken — even if you remove flash.step_summarizer.model from artemis.jsonc:

    # artemis/agents/flash/summarizer.py, VisualStepSummarizer.__init__
    if model_name:  # always true — the field default fills this in
        self._llm = get_google_llm(model_name=target_model, temperature=0.0)  # hardcodes GOOGLE
    else:
        self._llm = get_llm(ctx, name="summarizer", is_utils=True)

    Same pattern in artemis/memory/chunking.py (StepCapsuleLens._get_llm / _get_fallback_llm).

    For what it's worth, a minimal provider-aware patch we verified locally (step summarizer + history chunker now build ChatOpenAI against the configured OPENAI_BASE_URL): add a model-override helper next to get_google_llm() in artemis/services/llm.py that resolves the endpoint from a config node and only swaps model_name/temperature:

    def get_llm_with_overrides(ctx, name, is_utils=False, model_name=None, temperature=None):
        """Provider/credentials/base URL come from the config node; only model name/temperature are overridden."""
        ep = _resolve_endpoint(ctx, name, is_utils=is_utils)
        if model_name:
            ep.model_name = model_name
        if temperature is not None:
            ep.temperature = temperature
        return ModelFactory.get_model(ep)

    then call it from VisualStepSummarizer.__init__:

    self._llm = get_llm_with_overrides(
        ctx, "summarizer",
        model_name=target_model if model_name else None,
        temperature=0.0,
    )

    and from StepCapsuleLens._get_llm:

    self._llm = get_llm_with_overrides(self._ctx, "summarizer", model_name=self._model_name, temperature=0.0)

    Happy to help test #168 against the BigModel endpoint once it's ready for review.

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