CopilotKit / CopilotKit/outpost

Pass message author identity into the AI conversation history

Open
#173 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: ai roadmap roadmap: later
Dominant language
TypeScript
Stars
7
Forks
3
Avg merge
7d 16h
Merged PRs (30d)
15

Description

The support bot cannot tell who is speaking in a thread. This is the direct cause of the second incident behind #172: a maintainer asked a community member a follow-up question, and the bot answered the maintainer, explaining in its reply that it "can't see other users' replies."

It was telling the truth. It can't.

Where

packages/outpost/queue/src/handlers/ai-response.ts, building conversationHistory:

const conversationHistory = ticket.messages
    .filter((m) => m.type !== 'SYSTEM' && m !== openingUserMessage)
    .map((m) => ({
        role: (m.type === 'USER' ? 'user' : 'assistant') as 'user' | 'assistant',
        content: m.content,
    }));

Every non-SYSTEM message collapses to a bare user or assistant role derived from Message.type alone. Message.author is discarded. So the reporter, a maintainer, and an unrelated third party all arrive at the model as indistinguishable user turns.

Why it's worth doing

Message.author is already populated on every row — InboundHandler writes "${platformUsername} (${platformUserId})" for every platform. The data exists and is simply never handed to the model. This is a small change.

It also matters more now, not less. #172 caps the bot at one response per ticket, so the single answer it does write has to be right. Handing it a conversation where it cannot distinguish "the maintainer already solved this" from "the customer is still asking" is exactly the input that produced the incident.

Considerations

  • Deciding the shape matters more than the code. Options include prefixing content with the author, using the name field on message parts where the provider supports it, or passing a structured participant list alongside the history. Worth one deliberate decision rather than the first thing that works.
  • Team membership is already computable (isTeamMember in InboundHandler) and is the distinction that matters most: "a maintainer has spoken here." That overlaps with the human-presence gate work, so the two are worth designing together.
  • Author strings are user-controlled on most platforms. Whatever format is chosen should not let a display name masquerade as a role marker in the prompt.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/outpost/queue/src/handlers/ai-response.ts at conversationHistory, then inspect InboundHandler where Message.author and isTeamMember are populated. Decide and document a safe way to preserve author identity and maintainer participation without allowing user-controlled names to act as role markers. Done means the model can distinguish participants and team presence in the conversation history.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.