Skip to content

Add copy action for user messages in ChatKit embed (configurable) #156

@Vanalio

Description

@Vanalio

Hi ChatKit team — we’re integrating the ChatKit embed (web component + @openai/chatkit-react) and ran into what looks like a gap in message actions.

Summary

  • In the ChatKit embed UI, there’s a “copy/share message” affordance for assistant turns, but not for user messages.
  • We’d like to enable a copy icon/action on user messages as well (preferably behind an explicit option).

Current behavior

We also inspected the currently hosted ChatKit frame bundle and the clipboard text builder appears to only include assistant_message items (plus widgets when copy_text is present), and excludes user_message.

Repro (minimal)

  1. Load the embed script: https://cdn.platform.openai.com/deployments/chatkit/chatkit.js
  2. Mount <openai-chatkit> (or via @openai/chatkit-react) with a working backend.
  3. Send a user message and wait for an assistant response.
  4. Observe: assistant message has copy/share UI; user message does not.

Why it matters

  • In many chat UIs, users frequently want to copy their own prompt (reuse, quote, edit elsewhere, share with support, etc.).
  • In embed contexts, a “copy user message” action is especially useful because the host app often can’t easily augment per-message UI (cross-origin iframe).

Proposal (one possible API shape)

Option A: extend threadItemActions (keeps actions in one place)

threadItemActions: {
  feedback?: boolean;
  retry?: boolean;
  copy?: {
    enabled?: boolean;
    includeUserMessages?: boolean;        // default false for back-compat
    includeAssistantMessages?: boolean;   // default true (existing behavior)
  };
}

Option B: separate user message actions (more explicit)

userMessageActions?: {
  copy?: boolean;
}

Implementation notes (for your consideration)

  • For user_message.content, copy could concatenate input_text + input_tag text into plain text.
  • Attachments could be ignored, or appended as e.g. [attachment: filename].

Question

  • Is the absence of a user-message copy action intentional? If so, can the docs explicitly call it out?
  • If not intentional, we’d love to see a supported way to enable copy for user messages.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions