Skip to content

feat(workflows): expose humanAgentRoomName option on WarmTransferTask - #2056

Merged
toubatbrian merged 4 commits into
mainfrom
brian/warm-transfer-room-name
Jul 18, 2026
Merged

feat(workflows): expose humanAgentRoomName option on WarmTransferTask#2056
toubatbrian merged 4 commits into
mainfrom
brian/warm-transfer-room-name

Conversation

@toubatbrian

@toubatbrian toubatbrian commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Motivation

WarmTransferTask hardcodes the human-agent briefing room name as `${callerRoom.name}-human-agent` and relies on implicit room creation when the transfer agent connects. That makes it impossible to configure the briefing room ahead of time — most notably to attach a RoomComposite egress so the agent ↔ human-agent consultation leg of a warm transfer gets recorded (the caller-room leg is already recordable with a normal room egress; the consult room was not).

Changes

  • Add an optional humanAgentRoomName option to WarmTransferTaskOptions (defaults to the existing `${callerRoom.name}-human-agent`, so behavior is unchanged when unset).
  • Users can now pre-create the briefing room under this name (e.g. RoomServiceClient.createRoom with an egress request); the transfer agent then joins the pre-configured room instead of implicitly creating one with project defaults.
  • Extract name resolution into a resolveHumanAgentRoomName helper (module-level export for tests; not added to the package index).
  • Validation: empty string rejected eagerly in createWarmTransferTask; an override equal to the caller room name rejected at dial time.
  • No lifecycle changes: token grant, room.connect, createSipParticipant, deleteRoomOnClose, and all cancellation/teardown paths are untouched. The JSDoc documents that the room is deleted when the transfer completes/fails/cancels (which also ends any attached egress).

Example

const consultRoomName = `${ctx.room.name}-consult`;
await roomService.createRoom({
  name: consultRoomName,
  egress: new RoomEgress({
    room: new RoomCompositeEgressRequest({ audioOnly: true, fileOutputs: [...] }),
  }),
});

await new workflows.WarmTransferTask({
  sipCallTo: SUPERVISOR_PHONE_NUMBER,
  sipTrunkId: SIP_TRUNK_ID,
  humanAgentRoomName: consultRoomName,
  chatCtx: ctx.session.history,
}).run();

Testing

  • New unit tests in agents/src/workflows/warm_transfer.test.ts: default name resolution, override, same-name-as-caller rejection, empty-string rejection (4/4 passing).
  • Full agents/src suite: 1282 passed / 5 skipped; typecheck, build, and lint on touched files clean.
  • Changeset included (@livekit/agents: patch).

toubatbrian and others added 3 commits July 17, 2026 15:53
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@toubatbrian
toubatbrian requested a review from a team as a code owner July 17, 2026 22:55
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7f403da

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 37 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@theomonnom

Copy link
Copy Markdown
Member

I'm wondering if the name should just be room_name?

Per review feedback on #2056.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@toubatbrian
toubatbrian merged commit d34130f into main Jul 18, 2026
8 of 9 checks passed
@toubatbrian
toubatbrian deleted the brian/warm-transfer-room-name branch July 18, 2026 20:19
@github-actions github-actions Bot mentioned this pull request Jul 18, 2026
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.

3 participants