fix: clarify model availability and credit error guidance (#871)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-09 14:49:44 -08:00
committed by GitHub
parent 8e5bc3956f
commit faa022c317
4 changed files with 218 additions and 62 deletions

View File

@@ -9097,10 +9097,9 @@ ${SYSTEM_REMINDER_CLOSE}
}
if (!selectedModel) {
const cmd =
overlayCommand ??
commandRunner.start("/model", `Model not found: ${modelId}`);
cmd.fail(`Model not found: ${modelId}`);
const output = `Model not found: ${modelId}. Run /model and press R to refresh available models.`;
const cmd = overlayCommand ?? commandRunner.start("/model", output);
cmd.fail(output);
return;
}
const model = selectedModel;
@@ -9191,10 +9190,18 @@ ${SYSTEM_REMINDER_CLOSE}
});
} catch (error) {
const errorDetails = formatErrorDetails(error, agentId);
const modelLabel = selectedModel?.label ?? modelId;
const guidance =
"Run /model and press R to refresh available models. If the model is still unavailable, choose another model or connect a provider with /connect.";
const cmd =
overlayCommand ??
commandRunner.start("/model", "Failed to switch model.");
cmd.fail(`Failed to switch model: ${errorDetails}`);
commandRunner.start(
"/model",
`Failed to switch model to ${modelLabel}.`,
);
cmd.fail(
`Failed to switch model to ${modelLabel}: ${errorDetails}\n${guidance}`,
);
}
},
[