Skip to content

Spike: OpenUI react-lang inside the assistant (streaming, result binding, prompt size) #1529

Backlog

Description

@athvin

Part of #1528.

Why

Five decisions in the epic rest on reading OpenUI's docs and tarballs, not on running it. Prove them in this stack before building on them.

Questions to answer

Each question gets a recorded answer.

  1. Rendering in our stack. Does <Renderer> from @openuidev/react-lang 1.2.0 render inside a "use client" component on Next 16.4.6 and React 19.3.1?

    • It must raise no CSP violation report under script-src 'self' 'unsafe-inline' and connect-src 'self'.
    • It must make no network request beyond same-origin.
  2. Partial programs. Feed the Renderer one SSE delta at a time. What does it show:

    • mid-statement;
    • mid-string;
    • with a forward reference?

    Does anything flash, reflow or animate? Check against frontend-design-system/references/motion.md.

  3. Prose. Most answers are mostly sentences. Does that need a Prose component, or does the Renderer tolerate plain text? Pick one.

  4. Binding. Pick how a component names a tool result. Two options:

    • (a) A prop such as source: "toolu_…", resolved by our components from a client-side map that a new result SSE event fills.
    • (b) OpenUI's Query() with a toolProvider, which fetches again in the browser.

    The recommendation is (a): (b) fetches twice, and can show data the model never saw.

  5. Prompt size. Count tokens with messages.count_tokens for:

    • library.prompt() with a 3-component library;
    • the same with a 10-component library;
    • each of those plus the existing system prompt and tools.

    Does the stable prefix clear the model's minimum cacheable length?

  6. Model fit. Take 10 hand-written questions against the mock-erserver fixture data, using the deployment model (ERWEB_ASSISTANT_MODEL, default claude-opus-5).

    • Does the output parse?
    • Does it use only library components?
    • Does it bind rather than restate numbers?

Deliverable

  • A short write-up that amends design §5.8 in .claude/skills/frontend-design-system/references/frontend-design.md. It records the answers and the chosen binding mechanism. That doc PR closes this ticket.
  • The experiment branch is throwaway and is not merged.

Acceptance criteria

Activity

  1. added
    post-mvp
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    post-mvp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions