tirth8205/code-review-graph · error · ValueError

MiniMax refresh model must be '{resolved_model}', got '{mode

Error message

MiniMax refresh model must be '{resolved_model}', got '{model}'.

What it means

For provider='minimax', the MiniMax client embeds its resolved model into the provider identity string ('minimax:<model>'). refresh compares the requested model to that resolved model and refuses a mismatch to prevent cross-model vector migration.

Source

Thrown at code_review_graph/embeddings.py:1383

            ) from exc
        raise
    identities = {str(row["provider"]) for row in rows}

    embedding_store = EmbeddingStore(
        graph_store.db_path,
        provider=provider,
        model=model,
    )
    try:
        if not embedding_store.available or embedding_store.provider is None:
            raise RuntimeError(
                f"Embedding provider '{provider}' is unavailable in this environment.",
            )
        resolved_identity = embedding_store.provider.name
        if provider == "minimax":
            resolved_model = resolved_identity.partition(":")[2]
            if model != resolved_model:
                raise ValueError(
                    f"MiniMax refresh model must be '{resolved_model}', got '{model}'.",
                )
        if identities != {resolved_identity}:
            existing = ", ".join(sorted(identities))
            raise ValueError(
                "Embedding refresh refused: existing embeddings use "
                f"{existing}; requested provider resolves to {resolved_identity}.",
            )

        purged = embedding_store.purge_orphans()
        all_nodes: list[GraphNode] = []
        for file_path in graph_store.get_all_files():
            all_nodes.extend(graph_store.get_nodes_by_file(file_path))
        embedded = embedding_store.embed_nodes(all_nodes)
        return {"embedded": embedded, "purged": purged}
    finally:
        embedding_store.close()

View on GitHub (pinned to b58668751a)

Solutions

  1. Use the exact model from the error message: it tells you the required resolved_model
  2. Or query SELECT DISTINCT provider FROM embeddings to see the recorded identity ('minimax:<model>') and use that suffix
  3. If you truly want a new model, re-embed explicitly instead of refreshing

Example fix

# before
refresh_embeddings(gs, provider='minimax', model='embo-01')
# after
refresh_embeddings(gs, provider='minimax', model='minimax-text-embedding-01')  # value from error message
Defensive patterns

Strategy: validation

Validate before calling

row = gs._conn.execute("SELECT DISTINCT provider FROM embeddings LIMIT 1").fetchone()
recorded = row["provider"] if row else None
model = recorded.partition(":")[2] or model  # use recorded minimax model

Try / catch

try:
    refresh_embeddings(gs, provider="minimax", model=model)
except ValueError as e:
    if "MiniMax refresh model must be" in str(e):
        model = str(e).split("'")[1]  # take required model from message
        refresh_embeddings(gs, provider="minimax", model=model)
    else:
        raise

Prevention

When it happens

Trigger: Calling refresh_embeddings(provider='minimax', model=X) where the MiniMax provider resolved to a different model Y (identity is 'minimax:Y') — e.g. the service default model changed or you guessed the model name.

Common situations: MiniMax changing/renaming the default model server-side, or passing a model string that differs in casing/precision from what was originally embedded.

Related errors


AI-assisted analysis of tirth8205/code-review-graph@b58668751a (2026-08-28). Data as JSON: /api/errors/a08ab20485170070. Report an issue: GitHub.