it0/packages/services
hailin 635cca18fa feat(voice): long-lived agent session with proper hangup termination
Replace the per-turn POST /tasks approach for voice calls with a
long-lived agent run loop tied to the call lifecycle:

agent-service:
- Add AsyncQueue<T> utility for blocking message relay
- Add VoiceSessionManager: spawns one background run loop per voice call,
  accepts injected messages, terminates cleanly on hangup
- Add VoiceSessionController with 3 endpoints:
    POST   /api/v1/agent/sessions/voice/start  (call start)
    POST   /api/v1/agent/sessions/:id/voice/inject  (each speech turn)
    DELETE /api/v1/agent/sessions/:id/voice    (user hung up)
- Register VoiceSessionManager + VoiceSessionController in agent.module.ts

voice-agent:
- AgentServiceLLM: add start_voice_session(), terminate_voice_session(),
  inject_text_message() (voice/inject-aware), _do_inject_voice()
- AgentServiceLLMStream._run(): use voice/inject path when voice session
  is active; fall back to per-task POST for text-chat / non-SDK engines
- entrypoint(): call start_voice_session() after session.start();
  register _on_room_disconnect that calls terminate_voice_session()
  so the agent is always killed when the user hangs up

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 04:01:02 -08:00
..
agent-service feat(voice): long-lived agent session with proper hangup termination 2026-03-04 04:01:02 -08:00
audit-service fix: release QueryRunner connections to prevent pool exhaustion 2026-02-23 15:55:06 -08:00
auth-service feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
billing-service fix(billing-service): remove stale invoice.items reference after OneToMany removal 2026-03-04 01:49:23 -08:00
comm-service fix: release QueryRunner connections to prevent pool exhaustion 2026-02-23 15:55:06 -08:00
inventory-service feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
monitor-service fix: release QueryRunner connections to prevent pool exhaustion 2026-02-23 15:55:06 -08:00
ops-service fix(ops-service): add new TenantInfo quota fields to inline TenantContextService.run calls 2026-03-04 00:04:36 -08:00
version-service fix(version-service): use DatabaseModule.forRoot() for correct build path 2026-03-03 08:04:12 -08:00
voice-agent feat(voice): long-lived agent session with proper hangup termination 2026-03-04 04:01:02 -08:00
voice-service feat: add engine type selection (Agent SDK / Claude API) for voice calls 2026-03-02 02:11:51 -08:00