osborn 0.9.58 → 0.9.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +24 -22
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -2116,28 +2116,32 @@ async function main() {
2116
2116
  const session = new voice.AgentSession({
2117
2117
  turnDetection: 'stt',
2118
2118
  preemptiveGeneration: false, // Only fire LLM on final committed transcript, not partial preemptives
2119
+ // First-line echo defense: drop mic frames from BOTH the recognition stream
2120
+ // and the realtime audio stream for this many ms after the agent first
2121
+ // enters 'speaking' state. STT receives no audio during the warmup → no
2122
+ // interim/final transcripts can fire → echo cannot trigger an interrupt.
2123
+ // 1.4.x default is 3000; bumping to 5000 widens the safe zone at session start.
2124
+ // One-shot per session (NOT re-armed each turn), so this protects only the
2125
+ // first agent response. After that the in-block interruption settings handle it.
2126
+ aecWarmupDuration: 5000,
2119
2127
  turnHandling: {
2120
2128
  endpointing: {
2121
2129
  mode: 'fixed',
2122
2130
  minDelay: 500, // Wait 500ms after STT commits before generating reply
2123
2131
  maxDelay: 2000, // Force end-of-turn after 2s to prevent hangs
2124
2132
  },
2125
- // 0.9.57: bump falseInterruptionTimeout from default 2000ms 3000ms.
2126
- // This is the silence-after-interrupt window the SDK waits before
2127
- // emitting agentFalseInterruption + resuming. Extending it gives the
2128
- // user a fuller breath between low-level audio activity moments to
2129
- // accumulate a clean silence, which helps when echo or ambient noise
2130
- // keeps resetting the 2s window. Other tunables in this same block
2131
- // (NOT changed yet — try the timeout first, escalate if needed):
2132
- // - minDuration (default 500ms) — minimum sustained speech to count
2133
- // - minWords (default 0) — minimum word count in interim transcript
2134
- // - enabled (default true) — kept ON (auto-interrupt path active)
2135
- // - resumeFalseInterruption (default true) — auto-resume kept ON
2136
- // - discardAudioIfUninterruptible (default true)
2133
+ // 1.4.x SDK fully wires these minDuration now applies to the STT path
2134
+ // (not just VAD), falseInterruptionTimeout actually fires the
2135
+ // agentFalseInterruption event with auto-resume, discardAudioIfUninterruptible
2136
+ // is checked at runtime. All inert in 1.2.1; live in 1.4.x.
2137
2137
  interruption: {
2138
- falseInterruptionTimeout: 3000, // 2000 3000 (extra second of silence before resume)
2139
- minDuration: 1000, // 500 → 1000 (need 1s sustained speech to count)
2140
- minWords: 3, // 0 3 (interim transcript needs ≥3 words)
2138
+ // enabled defaults true kept default (don't set to false; cascades into
2139
+ // allowInterruptions:false which breaks manual interrupt() calls).
2140
+ minDuration: 1000, // 1.4.x: now gates STT-path; require 1s sustained speech
2141
+ minWords: 3, // require ≥3 words in interim transcript
2142
+ falseInterruptionTimeout: 2000, // emit agentFalseInterruption after 2s silence
2143
+ resumeFalseInterruption: true, // auto-resume TTS on false interrupt detection
2144
+ discardAudioIfUninterruptible: true, // drop buffered echo audio
2141
2145
  },
2142
2146
  },
2143
2147
  });
@@ -3041,13 +3045,11 @@ async function main() {
3041
3045
  userState = ev.newState;
3042
3046
  console.log(`👤 User state: ${prev} → ${ev.newState} (agent: ${agentState})`);
3043
3047
  if (ev.newState === 'speaking' && agentState === 'speaking' && sessionVoiceMode !== 'realtime') {
3044
- // Reverted to the simple post-May-22 (c345c98 / 0.9.39) shape in 0.9.56.
3045
- // The self-echo guard via lastRemoteSpeakerAt was defeated by the same
3046
- // physics it was trying to filter — TTS bleeds into the user's mic →
3047
- // LiveKit registers their participant as a remote speaker → the guard
3048
- // passes we interrupt anyway. Verified in osbornojure logs 2026-06-16
3049
- // (2 of 3 interrupts that session were from this handler firing on echo).
3050
- // Echo prevention moved to browser AEC on the publisher side.
3048
+ // Simple manual interrupt for echo-side defense fallback. With 1.4.x
3049
+ // the SDK's interrupt-by-audio-activity path is properly gated by
3050
+ // turnHandling.interruption.{minDuration, minWords, falseInterruptionTimeout},
3051
+ // and resumeFalseInterruption auto-recovers if echo was misclassified.
3052
+ // This handler stays as a secondary trigger only.
3051
3053
  try {
3052
3054
  console.log('🎤 user_state_changed=speaking + agent speaking → interrupting TTS');
3053
3055
  currentSession?.interrupt();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.58",
3
+ "version": "0.9.60",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {
@@ -33,14 +33,14 @@
33
33
  "@anthropic-ai/claude-agent-sdk": "^0.2.91",
34
34
  "@anthropic-ai/sdk": "^0.80.0",
35
35
  "@google/genai": "^1.0.0",
36
- "@livekit/agents": "1.2.1",
37
- "@livekit/agents-plugin-deepgram": "1.2.1",
38
- "@livekit/agents-plugin-elevenlabs": "1.2.1",
39
- "@livekit/agents-plugin-google": "1.2.1",
40
- "@livekit/agents-plugin-livekit": "1.2.1",
41
- "@livekit/agents-plugin-openai": "1.2.1",
42
- "@livekit/agents-plugin-silero": "1.2.1",
43
- "@livekit/rtc-node": "0.13.24",
36
+ "@livekit/agents": "1.4.6",
37
+ "@livekit/agents-plugin-deepgram": "1.4.6",
38
+ "@livekit/agents-plugin-elevenlabs": "1.4.6",
39
+ "@livekit/agents-plugin-google": "1.4.6",
40
+ "@livekit/agents-plugin-livekit": "1.4.6",
41
+ "@livekit/agents-plugin-openai": "1.4.6",
42
+ "@livekit/agents-plugin-silero": "1.4.6",
43
+ "@livekit/rtc-node": "0.13.29",
44
44
  "@modelcontextprotocol/sdk": "^1.29.0",
45
45
  "@openai/codex-sdk": "^0.77.0",
46
46
  "@smithery/api": "^0.48.0",