Commit Graph

10 Commits

Author SHA1 Message Date
Xiaohan-Tian 8323e6218c fix: use raw streaming chat completions and keep readable preview stacks
Switch OpenAI-compatible streaming from chat.completions.stream()
to chat.completions.create({ stream: true }) and track finish_reason
from streamed chunks directly.

This avoids the SDK's final chat-completion reconstruction path,
which could throw in preview builds while processing agent streams.

Also keep function/class names and sourcemaps in production builds
to make preview stack traces easier to read.

This issue can randomly happen when using `google/gemma-4-31b-it` model via OpenRouter.

Original error stacktrace:
```
index-Bh7OJFcp.js:807 Error processing stream: kn: Cannot read properties of undefined (reading 'type')
    at Bb.qJ (index-Bh7OJFcp.js:780:4436)Caused by: TypeError: Cannot read properties of undefined (reading 'type')
    at _J (index-Bh7OJFcp.js:780:1713)
    at index-Bh7OJFcp.js:780:416
    at Array.map (<anonymous>)
    at R6e (index-Bh7OJFcp.js:780:408)
    at z6e (index-Bh7OJFcp.js:785:258)
    at Bb.By (index-Bh7OJFcp.js:781:4928)
    at Bb._createChatCompletion (index-Bh7OJFcp.js:781:1059)
    at async Bb._runChatCompletion (index-Bh7OJFcp.js:780:6759)
```
2026-06-05 18:34:26 -07:00
Xiaohan-Tian 98c2b97413 feat: implemented the v1 browser embedded LLM support (Gemma 4 E4B based) 2026-05-14 18:55:23 -07:00
Xiaohan-Tian 8308cdf79a fix: removed https support from vite dev server 2026-04-18 14:38:09 -07:00
Xiaohan-Tian 7e67ca9d10 fix: add https support for local vite dev server 2026-04-18 14:27:07 -07:00
Xiaohan-Tian 1d5bb59ad7 fix: linter errors 2026-04-16 20:46:09 -07:00
Xiaohan-Tian 609efab64a fix: added a warning comment 2026-01-17 14:05:10 -08:00
Xiaohan-Tian e8b79efde7 feat: add option to persist API keys on non-localhost (opt-in security feature) 2026-01-17 13:54:15 -08:00
Xiaohan-Tian 0eac49493c feat: implement automated versioning. 2025-08-28 22:23:47 -07:00
Xiaohan-Tian bf085dacf2 introduce BASE_URL to the app and set it to /kgstudio/. 2025-08-11 22:35:51 -07:00
Xiaohan-Tian de51967b49 initial public release. 2025-08-11 18:37:21 -07:00