fix: correct model check for Codex API key validation

- Updated the model check logic to only consider "gpt-" prefixed models, removing the previous check for unsupported models.
- Adjusted error message for authentication failures to provide clearer guidance on resolving API key issues.
This commit is contained in:
Kacper
2025-12-13 13:46:07 +01:00
parent 8c33b1c751
commit c24cd9721c

View File

@@ -1092,7 +1092,7 @@ When done, summarize what you implemented and any notes for the developer.`;
if (block.text && (block.text.includes("Invalid API key") ||
block.text.includes("authentication_failed") ||
block.text.includes("Fix external API key"))) {
const isCodex = finalModel.startsWith("gpt-") || finalModel.startsWith("o");
const isCodex = finalModel.startsWith("gpt-")
const errorMsg = isCodex
? "Authentication failed: Invalid or expired API key. " +
"Please check your OPENAI_API_KEY or run 'codex login' to re-authenticate."