Skip to content

fix: retain human name in messages to agents - #198

Open
maxy-shpfy wants to merge 1 commit into
mainfrom
maxy/fix--retain-human-name-in-message
Open

maxy-shpfy wants to merge 1 commit into
mainfrom
maxy/fix--retain-human-name-in-message

Conversation

@maxy-shpfy

@maxy-shpfy maxy-shpfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Description

When several humans share a session, an agent reading its own thread had no way to tell its participants apart — every human Message arrived as bare content. This retains the sender's name on human-authored Messages delivered to the owner of a Conversation, so the agent can attend to who is actually speaking.

  • deliveryText now prefixes a human's own-thread Message with a Name: speaker label; an agent's own-thread Message still carries no label, and framing for relayed/opaque recipients is unchanged.
  • ParticipantService.ensureHuman materializes a human who turned up on their own — a session owner or an open-session guest no invite ever added — as an idempotent, inert roster member in the orchestrator's home Conversation, so the actor behind their messages is a real, listable Participant.
  • Chat join now calls ensureHuman for any human authorized to see the session before marking them present, so the connected transition lands on a row that already exists. A restricted session's uninvited visitor is still not materialized.
  • Prime's system prompt gains an operating rule telling it a session may have several humans and to answer the one asking.
  • Docs (docs/server/conversations.md) updated to describe the new owner-delivery labelling.

Screenshots

N/A — server-only behavior change.

How to test

  1. pnpm --filter @tangent/server test — new coverage in conversationRouter.test.ts, participantService.test.ts, and chat.test.ts asserts the speaker label, ensureHuman idempotency, and join-time materialization/presence.
  2. In a session with more than one human, send messages as different people and confirm the agent sees each prefixed with Name: and replies to the right person.

Notes

N/A

@maxy-shpfy
maxy-shpfy marked this pull request as ready for review November 19, 2026 17:54
@maxy-shpfy
maxy-shpfy requested a review from a team as a code owner November 19, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant