@vellumai/assistant 0.10.10-dev.202607201810.d417cba → 0.10.10-dev.202607201927.4faac34
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/openapi.yaml +65 -0
- package/package.json +1 -1
- package/src/cli/commands/__tests__/ps.test.ts +73 -12
- package/src/cli/commands/ps.help.ts +4 -1
- package/src/cli/commands/ps.ts +43 -14
- package/src/cli/lib/bundled-marketplace.json +13 -0
- package/src/config/assistant-feature-flags.ts +0 -15
- package/src/config/feature-flag-registry.json +0 -8
- package/src/live-voice/__tests__/live-voice-agent-turn.test.ts +2 -29
- package/src/live-voice/__tests__/live-voice-tts-session.test.ts +5 -40
- package/src/live-voice/__tests__/live-voice-vad.test.ts +0 -41
- package/src/live-voice/ack-phrases.ts +1 -1
- package/src/live-voice/live-voice-metrics.ts +8 -8
- package/src/live-voice/live-voice-session.ts +21 -28
- package/src/live-voice/protocol.ts +2 -2
- package/src/plugins/defaults/memory/routes/memory-item-routes.test.ts +168 -0
- package/src/plugins/defaults/memory/routes/memory-item-routes.ts +69 -0
- package/src/providers/provider-send-message.ts +11 -3
- package/src/runtime/routes/__tests__/inference-send-routes.test.ts +43 -5
- package/src/runtime/routes/__tests__/ps-routes.test.ts +42 -5
- package/src/runtime/routes/inference-send-routes.ts +4 -0
- package/src/runtime/routes/ps-routes.ts +15 -0
- package/src/util/__tests__/process-tree.test.ts +78 -12
- package/src/util/process-tree.ts +91 -13
- package/src/config/__tests__/assistant-feature-flags.test.ts +0 -40
package/openapi.yaml
CHANGED
|
@@ -17421,6 +17421,65 @@ paths:
|
|
|
17421
17421
|
- confident
|
|
17422
17422
|
- notes
|
|
17423
17423
|
additionalProperties: false
|
|
17424
|
+
/v1/memory/remember:
|
|
17425
|
+
post:
|
|
17426
|
+
operationId: memory_remember_post
|
|
17427
|
+
summary: Create a memory by remembering a fact
|
|
17428
|
+
description:
|
|
17429
|
+
Append a user-authored fact to the memory buffer via handleRemember; it is materialized into a graph node
|
|
17430
|
+
later by consolidation.
|
|
17431
|
+
tags:
|
|
17432
|
+
- memory
|
|
17433
|
+
requestBody:
|
|
17434
|
+
required: true
|
|
17435
|
+
content:
|
|
17436
|
+
application/json:
|
|
17437
|
+
schema:
|
|
17438
|
+
type: object
|
|
17439
|
+
properties:
|
|
17440
|
+
content:
|
|
17441
|
+
type: string
|
|
17442
|
+
required:
|
|
17443
|
+
- content
|
|
17444
|
+
responses:
|
|
17445
|
+
"200":
|
|
17446
|
+
description: Successful response
|
|
17447
|
+
content:
|
|
17448
|
+
application/json:
|
|
17449
|
+
schema:
|
|
17450
|
+
type: object
|
|
17451
|
+
properties:
|
|
17452
|
+
message:
|
|
17453
|
+
type: string
|
|
17454
|
+
success:
|
|
17455
|
+
type: boolean
|
|
17456
|
+
required:
|
|
17457
|
+
- message
|
|
17458
|
+
- success
|
|
17459
|
+
additionalProperties: false
|
|
17460
|
+
/v1/memory/stats:
|
|
17461
|
+
get:
|
|
17462
|
+
operationId: memory_stats_get
|
|
17463
|
+
summary: Get lightweight memory stats
|
|
17464
|
+
description:
|
|
17465
|
+
Return a cheap count of concept pages from the cached memory page index, for glanceable surfaces like the
|
|
17466
|
+
identity Memory card. Counts concept pages only and never builds the memory-concept graph.
|
|
17467
|
+
tags:
|
|
17468
|
+
- memory
|
|
17469
|
+
responses:
|
|
17470
|
+
"200":
|
|
17471
|
+
description: Successful response
|
|
17472
|
+
content:
|
|
17473
|
+
application/json:
|
|
17474
|
+
schema:
|
|
17475
|
+
type: object
|
|
17476
|
+
properties:
|
|
17477
|
+
concepts:
|
|
17478
|
+
type: number
|
|
17479
|
+
description: Number of concept pages in memory
|
|
17480
|
+
required:
|
|
17481
|
+
- concepts
|
|
17482
|
+
additionalProperties: false
|
|
17424
17483
|
/v1/memory/v2/backfill:
|
|
17425
17484
|
post:
|
|
17426
17485
|
operationId: memory_v2_backfill_post
|
|
@@ -33603,6 +33662,11 @@ components:
|
|
|
33603
33662
|
- running
|
|
33604
33663
|
- not_running
|
|
33605
33664
|
- unreachable
|
|
33665
|
+
origin:
|
|
33666
|
+
type: string
|
|
33667
|
+
enum:
|
|
33668
|
+
- plugin
|
|
33669
|
+
- workspace
|
|
33606
33670
|
children:
|
|
33607
33671
|
type: array
|
|
33608
33672
|
items:
|
|
@@ -33612,6 +33676,7 @@ components:
|
|
|
33612
33676
|
required:
|
|
33613
33677
|
- name
|
|
33614
33678
|
- status
|
|
33679
|
+
- origin
|
|
33615
33680
|
additionalProperties: false
|
|
33616
33681
|
AuthOutput:
|
|
33617
33682
|
oneOf:
|
package/package.json
CHANGED
|
@@ -133,7 +133,7 @@ describe("ps command — IPC wiring", () => {
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
describe("ps command — tree rendering", () => {
|
|
136
|
-
test("renders parent, indented children, and
|
|
136
|
+
test("renders parent, indented children, and plugin/workspace origin", async () => {
|
|
137
137
|
mockResponse = {
|
|
138
138
|
ok: true,
|
|
139
139
|
result: {
|
|
@@ -141,9 +141,14 @@ describe("ps command — tree rendering", () => {
|
|
|
141
141
|
{
|
|
142
142
|
name: "assistant",
|
|
143
143
|
status: "running",
|
|
144
|
+
origin: "workspace",
|
|
144
145
|
children: [
|
|
145
|
-
{ name: "qdrant", status: "running" },
|
|
146
|
-
{
|
|
146
|
+
{ name: "qdrant", status: "running", origin: "workspace" },
|
|
147
|
+
{
|
|
148
|
+
name: "memory-worker",
|
|
149
|
+
status: "running",
|
|
150
|
+
origin: "plugin:default-memory",
|
|
151
|
+
},
|
|
147
152
|
],
|
|
148
153
|
},
|
|
149
154
|
],
|
|
@@ -151,27 +156,83 @@ describe("ps command — tree rendering", () => {
|
|
|
151
156
|
};
|
|
152
157
|
|
|
153
158
|
await runPsCommand();
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
+
const lines = logLines.filter((l) => l.trim().length > 0);
|
|
160
|
+
|
|
161
|
+
// Column 1 keeps the hierarchy indentation; the origin column follows.
|
|
162
|
+
const root = lines.find((l) => l.startsWith("assistant"))!;
|
|
163
|
+
const qdrant = lines.find((l) => l.trimStart().startsWith("qdrant"))!;
|
|
164
|
+
const worker = lines.find((l) =>
|
|
165
|
+
l.trimStart().startsWith("memory-worker"),
|
|
166
|
+
)!;
|
|
167
|
+
|
|
168
|
+
expect(qdrant).toMatch(/^ {2}qdrant/);
|
|
169
|
+
expect(root).toContain("workspace");
|
|
170
|
+
expect(qdrant).toContain("workspace");
|
|
171
|
+
// The plugin's name is shown alongside the plugin tag.
|
|
172
|
+
expect(worker).toContain("plugin:default-memory");
|
|
173
|
+
|
|
174
|
+
// The status label is gone — no [running] anywhere.
|
|
175
|
+
expect(logLines.join("\n")).not.toContain("[running]");
|
|
159
176
|
});
|
|
160
177
|
|
|
161
|
-
test("
|
|
178
|
+
test("aligns column 2 to the same start index across all rows", async () => {
|
|
162
179
|
mockResponse = {
|
|
163
180
|
ok: true,
|
|
164
181
|
result: {
|
|
165
182
|
processes: [
|
|
166
|
-
{
|
|
183
|
+
{
|
|
184
|
+
name: "assistant",
|
|
185
|
+
status: "running",
|
|
186
|
+
origin: "workspace",
|
|
187
|
+
children: [
|
|
188
|
+
{
|
|
189
|
+
name: "qdrant",
|
|
190
|
+
status: "running",
|
|
191
|
+
origin: "workspace",
|
|
192
|
+
children: [
|
|
193
|
+
{
|
|
194
|
+
name: "deeply-nested-child",
|
|
195
|
+
status: "running",
|
|
196
|
+
origin: "plugin:cognee",
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
167
202
|
],
|
|
168
203
|
},
|
|
169
204
|
};
|
|
170
205
|
|
|
171
206
|
await runPsCommand();
|
|
172
|
-
|
|
173
|
-
|
|
207
|
+
const lines = logLines.filter((l) => l.trim().length > 0);
|
|
208
|
+
|
|
209
|
+
// The origin word starts at the same column on every row regardless of
|
|
210
|
+
// the depth-driven indentation in column 1.
|
|
211
|
+
const originStarts = lines.map((l) =>
|
|
212
|
+
l.indexOf("workspace") === -1
|
|
213
|
+
? l.indexOf("plugin")
|
|
214
|
+
: l.indexOf("workspace"),
|
|
174
215
|
);
|
|
216
|
+
expect(new Set(originStarts).size).toBe(1);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
test("shows the pid info column", async () => {
|
|
220
|
+
mockResponse = {
|
|
221
|
+
ok: true,
|
|
222
|
+
result: {
|
|
223
|
+
processes: [
|
|
224
|
+
{
|
|
225
|
+
name: "qdrant",
|
|
226
|
+
status: "running",
|
|
227
|
+
origin: "workspace",
|
|
228
|
+
info: "pid 4242",
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
await runPsCommand();
|
|
235
|
+
expect(logLines.join("\n")).toContain("pid 4242");
|
|
175
236
|
});
|
|
176
237
|
|
|
177
238
|
test("prints a placeholder when no processes are reported", async () => {
|
|
@@ -18,7 +18,10 @@ worker (when the daemon owns it), MCP servers, and any other live children.
|
|
|
18
18
|
The tree is built from the native process table (/proc on Linux, ps on
|
|
19
19
|
macOS), so it reflects what is actually running, not a fixed subsystem list.
|
|
20
20
|
|
|
21
|
-
Each node shows its
|
|
21
|
+
Each node shows its origin — 'workspace' for the daemon and its subsystems,
|
|
22
|
+
or 'plugin:<name>' for a process spawned from a plugin (e.g.
|
|
23
|
+
'plugin:default-memory', 'plugin:cognee') — plus its PID. Every listed
|
|
24
|
+
process is live by definition.
|
|
22
25
|
|
|
23
26
|
Examples:
|
|
24
27
|
$ assistant ps
|
package/src/cli/commands/ps.ts
CHANGED
|
@@ -19,6 +19,8 @@ import { psHelp } from "./ps.help.js";
|
|
|
19
19
|
interface ProcessEntry {
|
|
20
20
|
name: string;
|
|
21
21
|
status: "running" | "not_running" | "unreachable";
|
|
22
|
+
/** `workspace`, or `plugin:<name>` when spawned from a plugin. */
|
|
23
|
+
origin: "workspace" | `plugin:${string}`;
|
|
22
24
|
children?: ProcessEntry[];
|
|
23
25
|
info?: string;
|
|
24
26
|
}
|
|
@@ -27,20 +29,44 @@ interface PsResponse {
|
|
|
27
29
|
processes: ProcessEntry[];
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
/**
|
|
33
|
+
* One flattened output row. Column 1 (`name`) carries the hierarchy
|
|
34
|
+
* indentation; the remaining columns are aligned to a common start index
|
|
35
|
+
* across all rows regardless of tree depth.
|
|
36
|
+
*/
|
|
37
|
+
interface Row {
|
|
38
|
+
name: string;
|
|
39
|
+
origin: string;
|
|
40
|
+
info: string;
|
|
41
|
+
}
|
|
35
42
|
|
|
36
|
-
/**
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
/** Flatten the tree into rows, indenting each name to reflect tree depth. */
|
|
44
|
+
function flattenEntries(entry: ProcessEntry, depth: number, rows: Row[]): void {
|
|
45
|
+
rows.push({
|
|
46
|
+
name: " ".repeat(depth) + entry.name,
|
|
47
|
+
origin: entry.origin,
|
|
48
|
+
info: entry.info ?? "",
|
|
49
|
+
});
|
|
42
50
|
for (const child of entry.children ?? []) {
|
|
43
|
-
|
|
51
|
+
flattenEntries(child, depth + 1, rows);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Render the flattened rows as aligned columns. Column 1 keeps its per-row
|
|
57
|
+
* indentation for hierarchy; columns 2..N are padded to a shared width so
|
|
58
|
+
* every row's column starts at the same index. Status is not shown — the
|
|
59
|
+
* daemon only ever reports live processes, so a `[running]` label carries no
|
|
60
|
+
* information.
|
|
61
|
+
*/
|
|
62
|
+
function renderRows(rows: Row[]): void {
|
|
63
|
+
const nameWidth = Math.max(...rows.map((r) => r.name.length));
|
|
64
|
+
const originWidth = Math.max(...rows.map((r) => r.origin.length));
|
|
65
|
+
for (const r of rows) {
|
|
66
|
+
const line = `${r.name.padEnd(nameWidth)} ${r.origin.padEnd(
|
|
67
|
+
originWidth,
|
|
68
|
+
)} ${r.info}`;
|
|
69
|
+
log.info(line.trimEnd());
|
|
44
70
|
}
|
|
45
71
|
}
|
|
46
72
|
|
|
@@ -67,10 +93,13 @@ export function registerPsCommand(program: Command): void {
|
|
|
67
93
|
return;
|
|
68
94
|
}
|
|
69
95
|
|
|
70
|
-
|
|
96
|
+
const rows: Row[] = [];
|
|
71
97
|
for (const entry of processes) {
|
|
72
|
-
|
|
98
|
+
flattenEntries(entry, 0, rows);
|
|
73
99
|
}
|
|
100
|
+
|
|
101
|
+
log.info("");
|
|
102
|
+
renderRows(rows);
|
|
74
103
|
log.info("");
|
|
75
104
|
});
|
|
76
105
|
},
|
|
@@ -448,6 +448,19 @@
|
|
|
448
448
|
"homepage": "https://github.com/vellum-ai/writing-coach",
|
|
449
449
|
"license": "MIT",
|
|
450
450
|
"icon": "✍️"
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
"name": "battleship",
|
|
454
|
+
"source": {
|
|
455
|
+
"source": "github",
|
|
456
|
+
"repo": "vellum-ai/battleship",
|
|
457
|
+
"ref": "32391ea3af71597b7507bb710bd29ab8308a4604"
|
|
458
|
+
},
|
|
459
|
+
"description": "Play Battleship against your assistant. Fire shots, track hits and misses, and sink the fleet before the assistant sinks yours.",
|
|
460
|
+
"category": "hobby",
|
|
461
|
+
"homepage": "https://github.com/vellum-ai/battleship",
|
|
462
|
+
"license": "MIT",
|
|
463
|
+
"icon": "⚓"
|
|
451
464
|
}
|
|
452
465
|
]
|
|
453
466
|
}
|
|
@@ -326,18 +326,3 @@ 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
|
-
}
|
|
@@ -123,14 +123,6 @@
|
|
|
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
|
-
},
|
|
134
126
|
{
|
|
135
127
|
"id": "fast-mode",
|
|
136
128
|
"scope": "assistant",
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { describe, expect, mock, test } from "bun:test";
|
|
2
2
|
|
|
3
3
|
import { sanitizeForTts } from "../../calls/tts-text-sanitizer.js";
|
|
4
4
|
import type {
|
|
5
5
|
VoiceTurnCallbacks,
|
|
6
6
|
VoiceTurnOptions,
|
|
7
7
|
} from "../../calls/voice-session-bridge.js";
|
|
8
|
-
import {
|
|
9
|
-
clearCachedOverrides,
|
|
10
|
-
setCachedOverrides,
|
|
11
|
-
} from "../../config/feature-flag-cache.js";
|
|
12
8
|
import type { LiveVoiceFrontModelConfig } from "../../config/schemas/live-voice.js";
|
|
13
9
|
import type {
|
|
14
10
|
StreamingTranscriber,
|
|
@@ -459,9 +455,7 @@ describe("LiveVoiceSession assistant turn", () => {
|
|
|
459
455
|
});
|
|
460
456
|
});
|
|
461
457
|
|
|
462
|
-
describe("LiveVoiceSession tool-use spoken ack
|
|
463
|
-
afterEach(() => clearCachedOverrides());
|
|
464
|
-
|
|
458
|
+
describe("LiveVoiceSession tool-use spoken ack", () => {
|
|
465
459
|
const ACK_TIMEOUT_MS = 40;
|
|
466
460
|
// Acks pass through the same TTS sanitizer as regular segments; each fresh
|
|
467
461
|
// session's phrase counter starts at 0.
|
|
@@ -470,10 +464,6 @@ describe("LiveVoiceSession tool-use spoken ack (voice-front-model)", () => {
|
|
|
470
464
|
pickAckPhrase("first_delta", 0),
|
|
471
465
|
).trim();
|
|
472
466
|
|
|
473
|
-
function enableFrontModel(): void {
|
|
474
|
-
setCachedOverrides({ "voice-front-model": true }, { fromGateway: true });
|
|
475
|
-
}
|
|
476
|
-
|
|
477
467
|
function createCapturingTurnStarter(): {
|
|
478
468
|
startVoiceTurn: LiveVoiceTurnStarter;
|
|
479
469
|
getCallbacks: () => VoiceTurnCallbacks | undefined;
|
|
@@ -546,7 +536,6 @@ describe("LiveVoiceSession tool-use spoken ack (voice-front-model)", () => {
|
|
|
546
536
|
}
|
|
547
537
|
|
|
548
538
|
test("tool_use_start before any delta speaks an immediate tool ack and cancels the timer", async () => {
|
|
549
|
-
enableFrontModel();
|
|
550
539
|
const { frames, session, getCallbacks, ttsTexts } = createAckHarness();
|
|
551
540
|
|
|
552
541
|
await startReleasedTurn(session, getCallbacks);
|
|
@@ -571,7 +560,6 @@ describe("LiveVoiceSession tool-use spoken ack (voice-front-model)", () => {
|
|
|
571
560
|
});
|
|
572
561
|
|
|
573
562
|
test("tool_use_start after the first delta speaks no ack", async () => {
|
|
574
|
-
enableFrontModel();
|
|
575
563
|
const { frames, session, getCallbacks, ttsTexts } = createAckHarness();
|
|
576
564
|
|
|
577
565
|
await startReleasedTurn(session, getCallbacks);
|
|
@@ -585,7 +573,6 @@ describe("LiveVoiceSession tool-use spoken ack (voice-front-model)", () => {
|
|
|
585
573
|
});
|
|
586
574
|
|
|
587
575
|
test("tool_use_start after a first-delta ack already spoke adds no second ack", async () => {
|
|
588
|
-
enableFrontModel();
|
|
589
576
|
const { frames, session, getCallbacks, ttsTexts } = createAckHarness();
|
|
590
577
|
|
|
591
578
|
await startReleasedTurn(session, getCallbacks);
|
|
@@ -602,18 +589,4 @@ describe("LiveVoiceSession tool-use spoken ack (voice-front-model)", () => {
|
|
|
602
589
|
await waitFor(() => frames.some((frame) => frame.type === "tts_done"));
|
|
603
590
|
expect(ttsTexts).toEqual([EXPECTED_FIRST_DELTA_ACK, "Hello there."]);
|
|
604
591
|
});
|
|
605
|
-
|
|
606
|
-
test("tool_use_start speaks no ack when the flag is off", async () => {
|
|
607
|
-
const { frames, session, getCallbacks, ttsTexts } = createAckHarness();
|
|
608
|
-
|
|
609
|
-
await startReleasedTurn(session, getCallbacks);
|
|
610
|
-
getCallbacks()?.tool_use_start?.("web_search");
|
|
611
|
-
await new Promise((resolve) => setTimeout(resolve, ACK_TIMEOUT_MS + 40));
|
|
612
|
-
expect(ttsTexts).toEqual([]);
|
|
613
|
-
|
|
614
|
-
emitTextDelta(getCallbacks, "Hello there.");
|
|
615
|
-
emitMessageComplete(getCallbacks);
|
|
616
|
-
await waitFor(() => frames.some((frame) => frame.type === "tts_done"));
|
|
617
|
-
expect(ttsTexts).toEqual(["Hello there."]);
|
|
618
|
-
});
|
|
619
592
|
});
|
|
@@ -765,23 +765,18 @@ describe("LiveVoiceSession TTS", () => {
|
|
|
765
765
|
});
|
|
766
766
|
});
|
|
767
767
|
|
|
768
|
-
describe("LiveVoiceSession spoken ack
|
|
768
|
+
describe("LiveVoiceSession spoken ack", () => {
|
|
769
769
|
afterEach(() => clearCachedOverrides());
|
|
770
770
|
|
|
771
771
|
const ACK_TIMEOUT_MS = 40;
|
|
772
772
|
// The ack passes through the same TTS sanitizer as regular segments.
|
|
773
773
|
const EXPECTED_ACK = sanitizeForTts(pickAckPhrase("first_delta", 0)).trim();
|
|
774
774
|
|
|
775
|
-
function enableFrontModel(): void {
|
|
776
|
-
setCachedOverrides({ "voice-front-model": true }, { fromGateway: true });
|
|
777
|
-
}
|
|
778
|
-
|
|
779
775
|
const EXPECTED_BRIDGE = sanitizeForTts(FALLBACK_ESCALATION_BRIDGE).trim();
|
|
780
776
|
|
|
781
|
-
function
|
|
777
|
+
function enableEscalation(): void {
|
|
782
778
|
setCachedOverrides(
|
|
783
779
|
{
|
|
784
|
-
"voice-front-model": true,
|
|
785
780
|
"voice-mode": true,
|
|
786
781
|
[VOICE_TRIAGE_ESCALATE_FLAG]: true,
|
|
787
782
|
},
|
|
@@ -815,7 +810,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
815
810
|
}
|
|
816
811
|
|
|
817
812
|
test("speaks exactly one audio-only ack before agent audio on a slow first delta", async () => {
|
|
818
|
-
enableFrontModel();
|
|
819
813
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
820
814
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
821
815
|
const { frames, session } = createSessionHarness({
|
|
@@ -858,7 +852,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
858
852
|
});
|
|
859
853
|
|
|
860
854
|
test("speaks no ack when the first delta beats the timeout", async () => {
|
|
861
|
-
enableFrontModel();
|
|
862
855
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
863
856
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
864
857
|
const { frames, session } = createSessionHarness({
|
|
@@ -878,7 +871,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
878
871
|
});
|
|
879
872
|
|
|
880
873
|
test("interrupt before the timeout clears the timer and speaks no ack", async () => {
|
|
881
|
-
enableFrontModel();
|
|
882
874
|
const { startVoiceTurn } = createCapturingTurnStarter();
|
|
883
875
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
884
876
|
const { frames, session } = createSessionHarness({
|
|
@@ -895,27 +887,7 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
895
887
|
expect(frames.some((frame) => frame.type === "tts_audio")).toBe(false);
|
|
896
888
|
});
|
|
897
889
|
|
|
898
|
-
test("arms no ack when the flag is off", async () => {
|
|
899
|
-
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
900
|
-
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
901
|
-
const { frames, session } = createSessionHarness({
|
|
902
|
-
startVoiceTurn,
|
|
903
|
-
streamTtsAudio,
|
|
904
|
-
frontModelConfig: { ackFirstDeltaTimeoutMs: ACK_TIMEOUT_MS },
|
|
905
|
-
});
|
|
906
|
-
|
|
907
|
-
await startReleasedTurn(session);
|
|
908
|
-
await new Promise((resolve) => setTimeout(resolve, ACK_TIMEOUT_MS + 40));
|
|
909
|
-
expect(ttsTexts).toEqual([]);
|
|
910
|
-
|
|
911
|
-
getCallbacks()?.assistant_text_delta?.(makeTextDelta("Hello there."));
|
|
912
|
-
getCallbacks()?.message_complete?.(makeMessageComplete());
|
|
913
|
-
await waitFor(() => frames.some((frame) => frame.type === "tts_done"));
|
|
914
|
-
expect(ttsTexts).toEqual(["Hello there."]);
|
|
915
|
-
});
|
|
916
|
-
|
|
917
890
|
test("arms no ack without a TTS streamer", async () => {
|
|
918
|
-
enableFrontModel();
|
|
919
891
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
920
892
|
const { frames, session } = createSessionHarness({
|
|
921
893
|
startVoiceTurn,
|
|
@@ -934,7 +906,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
934
906
|
});
|
|
935
907
|
|
|
936
908
|
test("keeps the eager first-clause flush for the model's first segment after an ack", async () => {
|
|
937
|
-
enableFrontModel();
|
|
938
909
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
939
910
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
940
911
|
const { frames, session } = createSessionHarness({
|
|
@@ -981,7 +952,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
981
952
|
}
|
|
982
953
|
|
|
983
954
|
test("llmAckText on: speaks the front-model-phrased ack", async () => {
|
|
984
|
-
enableFrontModel();
|
|
985
955
|
const GENERATED = "Sure — one moment.";
|
|
986
956
|
// The generated text passes through the same TTS sanitizer as the
|
|
987
957
|
// static phrase.
|
|
@@ -1014,7 +984,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1014
984
|
});
|
|
1015
985
|
|
|
1016
986
|
test("llmAckText on: null generation falls back to the static phrase", async () => {
|
|
1017
|
-
enableFrontModel();
|
|
1018
987
|
const generateAckText = mock(async () => null);
|
|
1019
988
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
1020
989
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
@@ -1039,7 +1008,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1039
1008
|
});
|
|
1040
1009
|
|
|
1041
1010
|
test("llmAckText off (default): the decider is never consulted", async () => {
|
|
1042
|
-
enableFrontModel();
|
|
1043
1011
|
const generateAckText = mock(async () => "Never spoken.");
|
|
1044
1012
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
1045
1013
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
@@ -1061,7 +1029,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1061
1029
|
});
|
|
1062
1030
|
|
|
1063
1031
|
test("llmAckText on: a generation resolving around turn completion speaks no ack", async () => {
|
|
1064
|
-
enableFrontModel();
|
|
1065
1032
|
let resolveGeneration!: (text: string | null) => void;
|
|
1066
1033
|
const generateAckText = mock(
|
|
1067
1034
|
() =>
|
|
@@ -1099,7 +1066,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1099
1066
|
});
|
|
1100
1067
|
|
|
1101
1068
|
test("llmAckText on: a tool-use ack passes the tool name to the decider", async () => {
|
|
1102
|
-
enableFrontModel();
|
|
1103
1069
|
const GENERATED = "Let me search for that.";
|
|
1104
1070
|
const generateAckText = mock(
|
|
1105
1071
|
async (_input: VoiceAckTextInput) => GENERATED,
|
|
@@ -1131,7 +1097,7 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1131
1097
|
});
|
|
1132
1098
|
|
|
1133
1099
|
test("llmAckText on: a generation resolving after escalation hand-off speaks no ack", async () => {
|
|
1134
|
-
|
|
1100
|
+
enableEscalation();
|
|
1135
1101
|
let resolveGeneration!: (text: string | null) => void;
|
|
1136
1102
|
const generateAckText = mock(
|
|
1137
1103
|
() =>
|
|
@@ -1176,7 +1142,7 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1176
1142
|
});
|
|
1177
1143
|
|
|
1178
1144
|
test("static ack: a tool started on the escalated leg speaks nothing past the bridge", async () => {
|
|
1179
|
-
|
|
1145
|
+
enableEscalation();
|
|
1180
1146
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
1181
1147
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
1182
1148
|
const { frames, session } = createSessionHarness({
|
|
@@ -1207,7 +1173,7 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1207
1173
|
});
|
|
1208
1174
|
|
|
1209
1175
|
test("llmAckText on: tools started on the escalated leg trigger no ack generation", async () => {
|
|
1210
|
-
|
|
1176
|
+
enableEscalation();
|
|
1211
1177
|
const generateAckText = mock(async () => "Never spoken.");
|
|
1212
1178
|
const { startVoiceTurn, getCallbacks } = createCapturingTurnStarter();
|
|
1213
1179
|
const { streamTtsAudio, ttsTexts } = createRecordingTtsStreamer();
|
|
@@ -1241,7 +1207,6 @@ describe("LiveVoiceSession spoken ack (voice-front-model)", () => {
|
|
|
1241
1207
|
});
|
|
1242
1208
|
|
|
1243
1209
|
test("llmAckText on: a first delta during generation skips the ack entirely", async () => {
|
|
1244
|
-
enableFrontModel();
|
|
1245
1210
|
let resolveGeneration!: (text: string | null) => void;
|
|
1246
1211
|
const generateAckText = mock(
|
|
1247
1212
|
() =>
|