Auth probe retries network failures; lazy context init; CK repair logging

A thrown fetch in the auth probe is a network failure, not a 401 — it
now retries once before treating the user as logged out, and logs the
real cause (FE-15). Theme and privacy state initialize lazily from
localStorage so neither the wrong theme nor unmasked sensitive values
flash on reload (FE-07). The CopilotKit orphan-tool-call repair logs
when it has to skip instead of failing silently (FE-11).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Carlos Escalante
2026-06-10 17:30:26 -06:00
parent 2a68a05ffd
commit b5bb2e8562
4 changed files with 37 additions and 23 deletions

View File

@@ -382,7 +382,10 @@ app.all("/api/copilotkit/*", async (c) => {
headers: outbound.headers,
body: JSON.stringify({ ...body, messages: paired }),
});
} catch {
} catch (err) {
// Skipping the repair is survivable; doing it silently is not —
// orphan tool calls then fail downstream with no trace of why.
console.error("[copilotkit] orphan-tool-call repair skipped:", err);
return;
}
},