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:152 — applyAgentAttributes 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.
Deferred from review of #6. Not necessarily worth fixing for the demo — tracking only.
Two related issues in
VoiceAgentSessionstate mapping:1.
agentIdentityonly set whenlk.agent.stateattribute is presentVoiceAgentSession.swift:152 —
applyAgentAttributesreturns early viaguard let raw = attributes["lk.agent.state"]and never assignsagentIdentity. ThenappendAgentTranscriptgates onidentity == agentIdentity.Scenario: agent connects and speaks but its first attribute update lacks
lk.agent.state(or transcription segments arrive before the attribute) →agentIdentitystays nil → every segment is filtered out →agentTranscriptis empty forever.2.
handleConnectionState(.connected)never resetsagentStateVoiceAgentSession.swift:175 — the
.connectedcase only setsphase, leavingagentStateat.connecting.Scenario: a reconnect cycle (
.reconnecting→.connected) leaves the HUD spinning "Connecting to inspector…" until the next agent attribute update arrives.