Conversation
- Add Next.js server-side API route at /api/chat/glm-fallback that proxies to GLM (model/base URL/key all configurable via env vars, never public) - Refactor chat-stream.ts: extract shared SSE reader, add fallback logic that triggers on network errors, HTTP errors, or backend error deltas - Detect backend AI failure by matching the exact error stream_delta text rather than an SSE error event (backend sends errors as stream content) - Skip messagesQuery.refetch() after GLM response to prevent the backend's saved error message from overwriting the GLM response in the UI - Append a "not saved" notice at the end of every GLM fallback response - GLM system prompt includes full Kalori API reference and strict topic rules - Add GLM_BASE_URL, GLM_API_KEY, GLM_MODEL to .env.example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…norepo working-directory: packages/kal-frontend caused the path to be applied twice — once by the shell and once by Vercel reading rootDirectory from project config, producing .../packages/kal-frontend/packages/kal-frontend. Running all vercel commands from repo root lets Vercel resolve rootDirectory correctly. Also adds pnpm install and shared dep builds to the deploy job which were previously missing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Brief description of what this PR does.
🔗 Related Issue
Fixes #(issue number)
🏷️ Type of Change
✅ Checklist
dev(notmain)pnpm lint:fixpnpm typecheck📸 Screenshots (if applicable)
Add screenshots to help explain your changes.
🧪 How to Test
Steps to test this PR:
📝 Additional Notes
Any additional information reviewers should know.