{"record":{"id":"a08ab20485170070","repo":"tirth8205/code-review-graph","slug":"minimax-refresh-model-must-be-resolved-model","errorCode":null,"errorMessage":"MiniMax refresh model must be '{resolved_model}', got '{model}'.","messagePattern":"MiniMax refresh model must be '(.+?)', got '(.+?)'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"code_review_graph/embeddings.py","lineNumber":1383,"sourceCode":"            ) from exc\n        raise\n    identities = {str(row[\"provider\"]) for row in rows}\n\n    embedding_store = EmbeddingStore(\n        graph_store.db_path,\n        provider=provider,\n        model=model,\n    )\n    try:\n        if not embedding_store.available or embedding_store.provider is None:\n            raise RuntimeError(\n                f\"Embedding provider '{provider}' is unavailable in this environment.\",\n            )\n        resolved_identity = embedding_store.provider.name\n        if provider == \"minimax\":\n            resolved_model = resolved_identity.partition(\":\")[2]\n            if model != resolved_model:\n                raise ValueError(\n                    f\"MiniMax refresh model must be '{resolved_model}', got '{model}'.\",\n                )\n        if identities != {resolved_identity}:\n            existing = \", \".join(sorted(identities))\n            raise ValueError(\n                \"Embedding refresh refused: existing embeddings use \"\n                f\"{existing}; requested provider resolves to {resolved_identity}.\",\n            )\n\n        purged = embedding_store.purge_orphans()\n        all_nodes: list[GraphNode] = []\n        for file_path in graph_store.get_all_files():\n            all_nodes.extend(graph_store.get_nodes_by_file(file_path))\n        embedded = embedding_store.embed_nodes(all_nodes)\n        return {\"embedded\": embedded, \"purged\": purged}\n    finally:\n        embedding_store.close()\n","sourceCodeStart":1365,"sourceCodeEnd":1401,"githubUrl":"https://github.com/tirth8205/code-review-graph/blob/b58668751ab0c7670c078cf7cbd4d1f5b8e54f81/code_review_graph/embeddings.py#L1365-L1401","documentation":"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.","triggerScenarios":"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.","commonSituations":"MiniMax changing/renaming the default model server-side, or passing a model string that differs in casing/precision from what was originally embedded.","solutions":["Use the exact model from the error message: it tells you the required resolved_model","Or query SELECT DISTINCT provider FROM embeddings to see the recorded identity ('minimax:<model>') and use that suffix","If you truly want a new model, re-embed explicitly instead of refreshing"],"exampleFix":"# before\nrefresh_embeddings(gs, provider='minimax', model='embo-01')\n# after\nrefresh_embeddings(gs, provider='minimax', model='minimax-text-embedding-01')  # value from error message","handlingStrategy":"validation","validationCode":"row = gs._conn.execute(\"SELECT DISTINCT provider FROM embeddings LIMIT 1\").fetchone()\nrecorded = row[\"provider\"] if row else None\nmodel = recorded.partition(\":\")[2] or model  # use recorded minimax model","typeGuard":null,"tryCatchPattern":"try:\n    refresh_embeddings(gs, provider=\"minimax\", model=model)\nexcept ValueError as e:\n    if \"MiniMax refresh model must be\" in str(e):\n        model = str(e).split(\"'\")[1]  # take required model from message\n        refresh_embeddings(gs, provider=\"minimax\", model=model)\n    else:\n        raise","preventionTips":["Read the recorded provider identity from the embeddings table and reuse its model suffix","Don't guess MiniMax model names; they resolve server-side","For model changes use full re-embed, not refresh"],"tags":["minimax","embeddings","refresh","model-mismatch"],"backgroundTag":"model-version-mismatch","analyzedSha":"b58668751ab0c7670c078cf7cbd4d1f5b8e54f81","analyzedAt":"2026-08-28T13:19:08.966Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}