@vellumai/assistant 0.10.10-dev.202607201540.7d8113a → 0.10.10-dev.202607201748.b18908c

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/assistant",
3
- "version": "0.10.10-dev.202607201540.7d8113a",
3
+ "version": "0.10.10-dev.202607201748.b18908c",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -826,6 +826,14 @@ describe("AssistantConfigSchema", () => {
826
826
  maxTurnDurationMs: 30000,
827
827
  bargeInMinSpeechMs: 250,
828
828
  },
829
+ frontModel: {
830
+ endpointDecisionTimeoutMs: 1200,
831
+ endpointExtensionMs: 1500,
832
+ endpointMaxExtensions: 2,
833
+ ackFirstDeltaTimeoutMs: 2500,
834
+ ackGenerationTimeoutMs: 600,
835
+ llmAckText: false,
836
+ },
829
837
  maxSessionDurationSeconds: 1800,
830
838
  archiveAudio: false,
831
839
  });
@@ -1371,9 +1379,9 @@ describe("AssistantConfigSchema", () => {
1371
1379
  expect(TtsServiceSchema.safeParse({ provider: "vellum" }).success).toBe(
1372
1380
  true,
1373
1381
  );
1374
- expect(TtsServiceSchema.safeParse({ provider: "self-hosted" }).success).toBe(
1375
- false,
1376
- );
1382
+ expect(
1383
+ TtsServiceSchema.safeParse({ provider: "self-hosted" }).success,
1384
+ ).toBe(false);
1377
1385
  });
1378
1386
 
1379
1387
  // ── services.stt config ──────────────────────────────────────────────
@@ -180,6 +180,8 @@ export interface VoiceTurnCallbacks {
180
180
  ) => void;
181
181
  persisted_user_message_id?: (messageId: string) => void;
182
182
  persisted_assistant_message_id?: (messageId: string) => void;
183
+ /** Fired when the agent run starts a definitive tool use this turn. */
184
+ tool_use_start?: (toolName: string) => void;
183
185
  }
184
186
 
185
187
  export interface VoiceTurnOptions {
@@ -420,6 +422,7 @@ export async function startVoiceTurn(
420
422
  },
421
423
  onToolUse: (toolName, input) => {
422
424
  log.debug({ toolName, input }, "Voice turn tool_use event");
425
+ opts.callbacks?.tool_use_start?.(toolName);
423
426
  },
424
427
  };
425
428
 
@@ -0,0 +1,40 @@
1
+ import { afterEach, describe, expect, test } from "bun:test";
2
+
3
+ import {
4
+ clearFeatureFlagOverridesCache,
5
+ isVoiceFrontModelEnabled,
6
+ VOICE_FRONT_MODEL_FLAG,
7
+ } from "../assistant-feature-flags.js";
8
+ import { setCachedOverrides } from "../feature-flag-cache.js";
9
+ import type { AssistantConfig } from "../schema.js";
10
+
11
+ // The gate ignores the config arg (flags resolve from the override cache +
12
+ // bundled registry), so a bare cast is sufficient.
13
+ const CONFIG = {} as AssistantConfig;
14
+
15
+ afterEach(() => {
16
+ clearFeatureFlagOverridesCache();
17
+ });
18
+
19
+ describe("isVoiceFrontModelEnabled", () => {
20
+ test("is off by default (registry defaultEnabled: false)", () => {
21
+ clearFeatureFlagOverridesCache();
22
+ expect(isVoiceFrontModelEnabled(CONFIG)).toBe(false);
23
+ });
24
+
25
+ test("is on when the flag override is set", () => {
26
+ setCachedOverrides(
27
+ { [VOICE_FRONT_MODEL_FLAG]: true },
28
+ { fromGateway: true },
29
+ );
30
+ expect(isVoiceFrontModelEnabled(CONFIG)).toBe(true);
31
+ });
32
+
33
+ test("is off when the flag override is explicitly false", () => {
34
+ setCachedOverrides(
35
+ { [VOICE_FRONT_MODEL_FLAG]: false },
36
+ { fromGateway: true },
37
+ );
38
+ expect(isVoiceFrontModelEnabled(CONFIG)).toBe(false);
39
+ });
40
+ });
@@ -151,7 +151,9 @@ describe("resolver integration", () => {
151
151
  }
152
152
  const expected = CODE_DEFAULT_PROFILE_ENTRIES[dflt.profile];
153
153
  const resolved = resolveCallSiteConfig(callSite as LLMCallSite, llm);
154
- expect(resolved.model).toBe(expected.model as string);
154
+ // A site-level model pin (e.g. voiceFrontDecision's latency pin)
155
+ // legitimately overrides the profile's model.
156
+ expect(resolved.model).toBe((dflt.model ?? expected.model) as string);
155
157
  }
156
158
  });
157
159
 
@@ -326,3 +326,18 @@ export function isAssistantFeatureFlagEnabled(
326
326
  ): boolean {
327
327
  return !!getAssistantFeatureFlagValue(key, config);
328
328
  }
329
+
330
+ /**
331
+ * Temporary rollout flag for the live-voice front-model presence layer
332
+ * (semantic endpointing + spoken acks). Delete once default-on; permanent
333
+ * tunables live in `liveVoice.frontModel` config.
334
+ */
335
+ export const VOICE_FRONT_MODEL_FLAG = "voice-front-model" as const;
336
+
337
+ /**
338
+ * Whether the front-model presence layer is active for live voice.
339
+ * When false, every live-voice turn behaves exactly as before.
340
+ */
341
+ export function isVoiceFrontModelEnabled(config: AssistantConfig): boolean {
342
+ return isAssistantFeatureFlagEnabled(VOICE_FRONT_MODEL_FLAG, config);
343
+ }
@@ -8,6 +8,14 @@ type CallSiteDefaultConfig = {
8
8
  * rather than pinning a profile that may be unavailable.
9
9
  */
10
10
  profile?: string;
11
+ /**
12
+ * Direct model pin overriding the resolved profile's model. The resolver
13
+ * treats a bare model pin as catalog-implied: it stamps the model's
14
+ * catalog provider and keeps the provider-agnostic Vellum managed
15
+ * connection (see `resolveOverrideOrDefault`). Reserve for call sites
16
+ * whose latency envelope the profile's model cannot meet.
17
+ */
18
+ model?: string;
11
19
  maxTokens?: number;
12
20
  effort?: "none" | "low" | "medium" | "high" | "xhigh" | "max";
13
21
  temperature?: number | null;
@@ -113,6 +121,18 @@ export const CALL_SITE_DEFAULTS: Record<LLMCallSite, CallSiteDefaultConfig> = {
113
121
  effort: "low",
114
122
  thinking: { enabled: false },
115
123
  },
124
+ voiceFrontDecision: {
125
+ profile: "cost-optimized",
126
+ // Endpoint decisions gate live-voice turn-end latency, and the default
127
+ // profile's upstream cannot fit any usable decision budget (~1s+ per
128
+ // forced tool call). Pin a latency-optimized model instead — the bare
129
+ // model pin lets the catalog imply the provider, which preserves the
130
+ // provider-agnostic managed connection. Replace only with a model whose
131
+ // managed credentials are provisioned in every environment.
132
+ model: "claude-haiku-4-5-20251001",
133
+ effort: "low",
134
+ thinking: { enabled: false },
135
+ },
116
136
  inviteInstructionGenerator: {
117
137
  profile: "cost-optimized",
118
138
  effort: "low",
@@ -123,6 +123,14 @@
123
123
  "description": "When a user barges in during live voice, keep the interrupted turn running as a background subagent instead of discarding it (true-duplex handoff)",
124
124
  "defaultEnabled": false
125
125
  },
126
+ {
127
+ "id": "voice-front-model",
128
+ "scope": "assistant",
129
+ "key": "voice-front-model",
130
+ "label": "Voice Front Model",
131
+ "description": "Front-model presence layer for live voice (semantic endpointing + spoken acks). Temporary rollout flag: delete once default-on; permanent tunables live in liveVoice.frontModel config.",
132
+ "defaultEnabled": false
133
+ },
126
134
  {
127
135
  "id": "fast-mode",
128
136
  "scope": "assistant",
@@ -2,10 +2,20 @@ import { describe, expect, test } from "bun:test";
2
2
 
3
3
  import {
4
4
  LiveVoiceConfigSchema,
5
+ LiveVoiceFrontModelConfigSchema,
5
6
  LiveVoiceVadConfigSchema,
6
7
  VALID_LIVE_VOICE_MODES,
7
8
  } from "../live-voice.js";
8
9
 
10
+ const FRONT_MODEL_DEFAULTS = {
11
+ endpointDecisionTimeoutMs: 1200,
12
+ endpointExtensionMs: 1500,
13
+ endpointMaxExtensions: 2,
14
+ ackFirstDeltaTimeoutMs: 2500,
15
+ ackGenerationTimeoutMs: 600,
16
+ llmAckText: false,
17
+ };
18
+
9
19
  describe("LiveVoiceVadConfigSchema", () => {
10
20
  test("empty object parses to defaults", () => {
11
21
  const parsed = LiveVoiceVadConfigSchema.parse({});
@@ -57,6 +67,55 @@ describe("LiveVoiceVadConfigSchema", () => {
57
67
  });
58
68
  });
59
69
 
70
+ describe("LiveVoiceFrontModelConfigSchema", () => {
71
+ test("empty object parses to defaults", () => {
72
+ const parsed = LiveVoiceFrontModelConfigSchema.parse({});
73
+ expect(parsed).toEqual(FRONT_MODEL_DEFAULTS);
74
+ });
75
+
76
+ test("accepts overrides", () => {
77
+ const parsed = LiveVoiceFrontModelConfigSchema.parse({
78
+ endpointDecisionTimeoutMs: 400,
79
+ endpointMaxExtensions: 0,
80
+ llmAckText: true,
81
+ });
82
+ expect(parsed.endpointDecisionTimeoutMs).toBe(400);
83
+ expect(parsed.endpointMaxExtensions).toBe(0);
84
+ expect(parsed.llmAckText).toBe(true);
85
+ // Unspecified fields still get defaults
86
+ expect(parsed.endpointExtensionMs).toBe(1500);
87
+ expect(parsed.ackFirstDeltaTimeoutMs).toBe(2500);
88
+ expect(parsed.ackGenerationTimeoutMs).toBe(600);
89
+ });
90
+
91
+ test("rejects non-positive endpointDecisionTimeoutMs", () => {
92
+ const result = LiveVoiceFrontModelConfigSchema.safeParse({
93
+ endpointDecisionTimeoutMs: 0,
94
+ });
95
+ expect(result.success).toBe(false);
96
+ });
97
+
98
+ test("rejects negative endpointMaxExtensions", () => {
99
+ const result = LiveVoiceFrontModelConfigSchema.safeParse({
100
+ endpointMaxExtensions: -1,
101
+ });
102
+ expect(result.success).toBe(false);
103
+ });
104
+
105
+ test("rejects a non-boolean llmAckText", () => {
106
+ const result = LiveVoiceFrontModelConfigSchema.safeParse({
107
+ llmAckText: "yes",
108
+ });
109
+ expect(result.success).toBe(false);
110
+ if (!result.success) {
111
+ const msgs = result.error.issues.map((i) => i.message);
112
+ expect(
113
+ msgs.some((m) => m.includes("liveVoice.frontModel.llmAckText")),
114
+ ).toBe(true);
115
+ }
116
+ });
117
+ });
118
+
60
119
  describe("LiveVoiceConfigSchema", () => {
61
120
  test("empty object parses to defaults", () => {
62
121
  const parsed = LiveVoiceConfigSchema.parse({});
@@ -68,6 +127,7 @@ describe("LiveVoiceConfigSchema", () => {
68
127
  maxTurnDurationMs: 30_000,
69
128
  bargeInMinSpeechMs: 250,
70
129
  },
130
+ frontModel: FRONT_MODEL_DEFAULTS,
71
131
  maxSessionDurationSeconds: 1800,
72
132
  // Off by default: voice turns carry only their transcript, no audio
73
133
  // artifacts on the conversation messages (JARVIS-1283).
@@ -94,6 +154,7 @@ describe("LiveVoiceConfigSchema", () => {
94
154
  const parsed = LiveVoiceConfigSchema.parse({
95
155
  mode: "ptt",
96
156
  vad: { silenceThresholdMs: 900 },
157
+ frontModel: { endpointDecisionTimeoutMs: 300 },
97
158
  maxSessionDurationSeconds: 600,
98
159
  });
99
160
  expect(parsed.mode).toBe("ptt");
@@ -101,6 +162,9 @@ describe("LiveVoiceConfigSchema", () => {
101
162
  // Unspecified vad fields still get defaults
102
163
  expect(parsed.vad.speechEnergyThreshold).toBe(800);
103
164
  expect(parsed.vad.maxTurnDurationMs).toBe(30_000);
165
+ // Partial frontModel overrides merge with defaults
166
+ expect(parsed.frontModel.endpointDecisionTimeoutMs).toBe(300);
167
+ expect(parsed.frontModel.endpointExtensionMs).toBe(1500);
104
168
  expect(parsed.maxSessionDurationSeconds).toBe(600);
105
169
  });
106
170
 
@@ -289,6 +289,13 @@ const CATALOG_RECORD: CatalogRecord = {
289
289
  "Captions images via a vision-capable profile for text-only model fallback.",
290
290
  domain: "skills",
291
291
  },
292
+ voiceFrontDecision: {
293
+ id: "voiceFrontDecision",
294
+ displayName: "Voice Front Decision",
295
+ description:
296
+ "Fast turn-taking and presence decisions during live voice (semantic endpointing, ack generation).",
297
+ domain: "agentLoop",
298
+ },
292
299
  homeGreeting: {
293
300
  id: "homeGreeting",
294
301
  displayName: "Home Greeting",
@@ -47,6 +47,76 @@ export const LiveVoiceVadConfigSchema = z
47
47
  "Voice-activity-detection tuning for live voice sessions (open-mic turn segmentation)",
48
48
  );
49
49
 
50
+ export const LiveVoiceFrontModelConfigSchema = z
51
+ .object({
52
+ endpointDecisionTimeoutMs: z
53
+ .number({
54
+ error:
55
+ "liveVoice.frontModel.endpointDecisionTimeoutMs must be a number",
56
+ })
57
+ .int("liveVoice.frontModel.endpointDecisionTimeoutMs must be an integer")
58
+ .positive(
59
+ "liveVoice.frontModel.endpointDecisionTimeoutMs must be a positive integer",
60
+ )
61
+ .default(1200)
62
+ .describe(
63
+ "Hard budget (ms) for the endpoint decision LLM call. This adds to end-of-turn latency when semantic endpointing is on, so keep it as tight as the decider model's real roundtrip allows — measured Haiku roundtrips through the managed proxy run ~670-1130ms (dev), so tighter budgets turn the feature into a fail-open no-op.",
64
+ ),
65
+ endpointExtensionMs: z
66
+ .number({
67
+ error: "liveVoice.frontModel.endpointExtensionMs must be a number",
68
+ })
69
+ .int("liveVoice.frontModel.endpointExtensionMs must be an integer")
70
+ .positive(
71
+ "liveVoice.frontModel.endpointExtensionMs must be a positive integer",
72
+ )
73
+ .default(1500)
74
+ .describe(
75
+ "How long (ms) a 'hold' decision keeps the turn open before turn-end replays",
76
+ ),
77
+ endpointMaxExtensions: z
78
+ .number({
79
+ error: "liveVoice.frontModel.endpointMaxExtensions must be a number",
80
+ })
81
+ .int("liveVoice.frontModel.endpointMaxExtensions must be an integer")
82
+ .nonnegative(
83
+ "liveVoice.frontModel.endpointMaxExtensions must be a nonnegative integer",
84
+ )
85
+ .default(2)
86
+ .describe("Cap on consecutive 'hold' extensions per utterance"),
87
+ ackFirstDeltaTimeoutMs: z
88
+ .number({
89
+ error: "liveVoice.frontModel.ackFirstDeltaTimeoutMs must be a number",
90
+ })
91
+ .int("liveVoice.frontModel.ackFirstDeltaTimeoutMs must be an integer")
92
+ .positive(
93
+ "liveVoice.frontModel.ackFirstDeltaTimeoutMs must be a positive integer",
94
+ )
95
+ .default(2500)
96
+ .describe(
97
+ "Keyword-delay budget (ms): a spoken ack fires if no first assistant delta has arrived by then",
98
+ ),
99
+ ackGenerationTimeoutMs: z
100
+ .number({
101
+ error: "liveVoice.frontModel.ackGenerationTimeoutMs must be a number",
102
+ })
103
+ .int("liveVoice.frontModel.ackGenerationTimeoutMs must be an integer")
104
+ .positive(
105
+ "liveVoice.frontModel.ackGenerationTimeoutMs must be a positive integer",
106
+ )
107
+ .default(600)
108
+ .describe("Budget (ms) for LLM-generated ack text"),
109
+ llmAckText: z
110
+ .boolean({ error: "liveVoice.frontModel.llmAckText must be a boolean" })
111
+ .default(false)
112
+ .describe(
113
+ "Use the front model to phrase spoken acks; static phrases otherwise",
114
+ ),
115
+ })
116
+ .describe(
117
+ "Front-model presence layer tuning for live voice sessions (semantic endpointing + spoken acks)",
118
+ );
119
+
50
120
  export const LiveVoiceConfigSchema = z
51
121
  .object({
52
122
  mode: z
@@ -58,6 +128,9 @@ export const LiveVoiceConfigSchema = z
58
128
  "Default microphone mode for live voice sessions — hands-free (open-mic) or push-to-talk (ptt)",
59
129
  ),
60
130
  vad: LiveVoiceVadConfigSchema.default(LiveVoiceVadConfigSchema.parse({})),
131
+ frontModel: LiveVoiceFrontModelConfigSchema.default(
132
+ LiveVoiceFrontModelConfigSchema.parse({}),
133
+ ),
61
134
  maxSessionDurationSeconds: z
62
135
  .number({
63
136
  error: "liveVoice.maxSessionDurationSeconds must be a number",
@@ -81,3 +154,6 @@ export const LiveVoiceConfigSchema = z
81
154
 
82
155
  export type LiveVoiceConfig = z.infer<typeof LiveVoiceConfigSchema>;
83
156
  export type LiveVoiceVadConfig = z.infer<typeof LiveVoiceVadConfigSchema>;
157
+ export type LiveVoiceFrontModelConfig = z.infer<
158
+ typeof LiveVoiceFrontModelConfigSchema
159
+ >;
@@ -88,6 +88,7 @@ export const LLMCallSiteEnum = z.enum([
88
88
  "skillCategoryInference",
89
89
  "inference",
90
90
  "vision",
91
+ "voiceFrontDecision",
91
92
  "trustRuleSuggestion",
92
93
  "homeGreeting",
93
94
  "homeSuggestedPrompts",