Skip to content

Auxiliary client cache hit bypasses model slug compatibility check #5809

@eddieran

Description

@eddieran

Bug

_get_cached_client() returns model or cached_default on cache hits without checking whether the model slug is compatible with the cached provider. resolve_provider_client() has a guard that drops OpenRouter-format slugs (containing /) for non-OpenRouter providers, but this guard is skipped entirely on cache hits.

Reproduction

config.yaml:

model:
  default: gpt-5.4
  provider: openai-codex
compression:
  summary_model: google/gemini-3-flash-preview
  1. Any auxiliary call (e.g. flush_memories) resolves provider="auto" → caches CodexAuxiliaryClient under key ("auto", False, "", "", 0)
  2. Compression call with model="google/gemini-3-flash-preview" hits the same cache key (model is not part of the key) → returns (codex_client, "google/gemini-3-flash-preview")
  3. google/gemini-3-flash-preview is sent to chatgpt.com/backend-api/codex which doesn't understand it

Expected

The / guard in resolve_provider_client() should also apply on cache hits, dropping incompatible slugs in favor of the cached default model.

Fix

PR #5804

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions