Skip to content

Voice agent: transcript can stay empty / HUD stuck after reconnect #7

Description

@tangxiya-star

Deferred from review of #6. Not necessarily worth fixing for the demo — tracking only.

Two related issues in VoiceAgentSession state mapping:

1. agentIdentity only set when lk.agent.state attribute is present
VoiceAgentSession.swift:152applyAgentAttributes returns early via guard let raw = attributes["lk.agent.state"] and never assigns agentIdentity. Then appendAgentTranscript gates on identity == agentIdentity.

Scenario: agent connects and speaks but its first attribute update lacks lk.agent.state (or transcription segments arrive before the attribute) → agentIdentity stays nil → every segment is filtered out → agentTranscript is empty forever.

2. handleConnectionState(.connected) never resets agentState
VoiceAgentSession.swift:175 — the .connected case only sets phase, leaving agentState at .connecting.

Scenario: a reconnect cycle (.reconnecting.connected) leaves the HUD spinning "Connecting to inspector…" until the next agent attribute update arrives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfollow-upKnown issue, deferred from reviewvoice-agentLiveKit voice inspection agent

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions