- Preview errors reach the agent: a studio-only reporter in the srcdoc
relays uncaught errors, rejections, failed loads and embed:error to the
parent; the studio shows "The chart threw ... [Fix it]" and sends one
automatic fix per user message.
- Versions per agent turn in Y.Map("embed-versions") (shared, capped at
20): vN / Restore / Compare under each reply, Undo last change; restore
appends a copy so history stays linear.
- Starter and follow-up prompt chips, preview width presets (Article,
Wide, 360) and a local light/dark toggle pushed with setTheme.
- The agent's title and source land on the node; Shiki code view with
Copy and Download.
- Provider errors keep their HTTP status; 401/402/429 become actionable
messages with Retry; model name in the header; Done replaces
Save & Close; no more fake "Generating chart..." banner.
- Minimal mobile layout: files drawer and Chat / Preview tabs under 900px.
Co-authored-by: Cursor <cursoragent@cursor.com>
feat(embeds): shared Embed.mount runtime, checker, gallery and evals
- Own the embed runtime and authoring guides in embed-kit/ and generate the
runtime and agent skill into backend/src from them.
- Embed Studio prompts and tools target the Embed.mount contract; seed
embeds are migrated to it.
- Add a headless checker (check:embeds), an eval harness with comparison
report, and a gallery of showcase embeds and banners.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(agent): disable response buffering for chat streaming
The AI SDK streams tokens chunk-by-chunk via \`streamText\` +
\`toUIMessageStreamResponse\`, but on a HF Space the response
went through layers that re-coalesced everything into one big
payload arriving at message end:
- Nginx in front of the Space buffers responses by default
unless \`X-Accel-Buffering: no\` is set;
- transparent gzip on the path holds chunks until the
compression window fills;
- TCP_NODELAY off keeps small writes in the kernel until they
reach MTU.
End result: the user saw \"Thinking...\" then the whole
assistant reply dropped at once, masking the streaming.
Fix:
- Set \`X-Accel-Buffering: no\` and \`Content-Encoding: identity\`
on the streamed response so proxies pass bytes through as
they arrive.
- Add \`Cache-Control: no-cache, no-transform\` to also block
transforming/compressing intermediaries.
- Call \`res.flushHeaders()\` so the browser commits to streaming
mode immediately (first-byte triggers progressive rendering
of the assistant bubble)…
fix(agent): default back to gpt-oss-120b, pin Llama 3.3 to Together
Groq (HF Router's :fastest pick for Llama 3.3 70B) validates tool calls
very strictly and was rejecting the editor's 18-tool registry with
"Failed to call a function. Please adjust your prompt." Fireworks has
deprecated the Llama 3.3 checkpoint; Nscale doesn't support the `tools`
parameter at all. Together serves the same model with full
tool-calling support, so pin Llama 3.3 to `:together`.
Restore openai/gpt-oss-120b as the default - it's HF's trending
tool-calling model and the reasoning-strip fix already covers the
Cerebras round-trip case.
Co-authored-by: Cursor <cursoragent@cursor.com>
fix(agent): strip reasoning_content from history, default to Llama 3.3 70B
Reasoning models (gpt-oss-*, DeepSeek R1, ...) emit a `reasoning` UI part
alongside their text answer. The AI SDK persists those parts and on the
next turn round-trips them as `reasoning_content` on the assistant
message - which some HF Inference Providers (notably Cerebras, the
default for gpt-oss) reject with 400 wrong_api_format. The model doesn't
need to see its own prior reasoning to keep the conversation going, so
filter those parts out before convertToModelMessages.
While we're at it, swap the default model from gpt-oss-120b to
meta-llama/Llama-3.3-70B-Instruct: it doesn't emit reasoning, works
across every provider exposing it, and is a more conservative starting
point for first-time forkers.
Co-authored-by: Cursor <cursoragent@cursor.com>
feat(agent): switch AI backend from OpenRouter to HF Inference Providers
The chat panel and embed studio now call Hugging Face Inference Providers
(OpenAI-compatible router at https://router.huggingface.co/v1) via
@ai-sdk/openai-compatible, using the logged-in editor's OAuth token when
available and falling back to HF_TOKEN. Forking the Space no longer
requires wiring an OpenRouter API key - the user's own HF token funds
their own inference.
- Replace @openrouter/ai-sdk-provider with @ai-sdk/openai-compatible
- Forward the OAuth cookie token per request, fallback to HF_TOKEN
- Refresh AVAILABLE_MODELS to HF-served, tool-calling-capable models
(gpt-oss 120B/20B, Llama 3.3 70B, Qwen3 Coder 480B, DeepSeek V3.1)
- Add inference-api to hf_oauth_scopes and document the new env vars
(HF_INFERENCE_MODEL, expanded HF_TOKEN role) in README + SPECIFICATION
- Update agent-chat tests to expect the new "Hugging Face token" error
Co-authored-by: Cursor <cursoragent@cursor.com>
refactor(backend): modular server split with new routes, persistence and agent layer
- Introduce create-app factory to compose routes, middleware and Hocuspocus in isolation
- Extract route modules (auth, chat, publish) and move storage logic into persistence.ts
- Harden auth + HF storage integration (user token fallback, secure cookie in production)
- Add embed studio AI pipeline (embed-chat, embed-tools, system prompt) and shared stream handler
- Cover the new surface with api-routes, persistence and agent-chat test suites
- Ship .env.example and .gitignore so new contributors can boot without guesswork
Made-with: Cursor