Fix three plan message issues:
1. Fix Ollama 504 Gateway Timeout - add 30s timeout to prevent long hangs 2. Add Ollama to provider error classification for proper fallback handling 3. Show model selector when proceed with build modal opens These fixes ensure Ollama failures are handled gracefully with proper fallback to Groq, and users can select their model before starting the build.
This commit is contained in:
@@ -107,6 +107,13 @@ function updateBuildModeUI(modeOverride) {
|
||||
async function proceedWithBuild(planContent) {
|
||||
if (!planContent) return;
|
||||
pendingPlanContent = planContent;
|
||||
|
||||
// Show model selector when build confirmation modal opens
|
||||
// This allows user to choose their model before starting the build
|
||||
if (el.modelSelectWrap) {
|
||||
el.modelSelectWrap.style.display = 'inline-flex';
|
||||
}
|
||||
|
||||
if (el.confirmBuildModal) {
|
||||
el.confirmBuildModal.style.display = 'flex';
|
||||
} else {
|
||||
|
||||
@@ -8561,7 +8561,12 @@ async function sendOllamaChat({ messages, model }) {
|
||||
|
||||
const payload = { model: targetModel, prompt };
|
||||
|
||||
const res = await fetch(endpoint, { method: 'POST', headers, body: JSON.stringify(payload) });
|
||||
const res = await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body: JSON.stringify(payload),
|
||||
signal: AbortSignal.timeout(30000) // 30 second timeout to prevent 504 gateway timeouts
|
||||
});
|
||||
if (!res.ok) {
|
||||
let detail = '';
|
||||
try { detail = await res.text(); } catch (_) { }
|
||||
@@ -9708,6 +9713,14 @@ function classifyProviderError(error, provider) {
|
||||
userError: [400, 413],
|
||||
notFound: 404
|
||||
},
|
||||
ollama: {
|
||||
transient: [500, 502, 503, 504, 529],
|
||||
rateLimit: 429,
|
||||
auth: 401,
|
||||
permission: 403,
|
||||
userError: [400],
|
||||
notFound: 404
|
||||
},
|
||||
default: {
|
||||
transient: [500, 502, 503, 529],
|
||||
rateLimit: 429,
|
||||
|
||||
Reference in New Issue
Block a user