@vellumai/assistant 0.11.2-dev.202608051734.355dff7 → 0.11.2-dev.202608051933.deffc0f
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/ARCHITECTURE.md +4 -2
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/ingress.ts +10 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/ingress.ts +10 -0
- package/node_modules/@vellumai/service-contracts/src/ingress.ts +10 -0
- package/openapi.yaml +22 -0
- package/package.json +1 -1
- package/src/__tests__/agent-loop-override-profile.test.ts +38 -48
- package/src/__tests__/assistant-feature-flags-integration.test.ts +0 -10
- package/src/__tests__/conversation-tool-setup-app-refresh.test.ts +1 -0
- package/src/__tests__/conversation-tool-setup-attribution.test.ts +61 -0
- package/src/__tests__/cu-unified-flow.test.ts +2 -6
- package/src/__tests__/file-ops-service.test.ts +75 -4
- package/src/__tests__/host-bash-proxy.test.ts +10 -5
- package/src/__tests__/host-browser-proxy.test.ts +2 -2
- package/src/__tests__/host-cu-proxy.test.ts +3 -7
- package/src/__tests__/host-file-proxy.test.ts +3 -7
- package/src/__tests__/host-file-read-tool.test.ts +5 -1
- package/src/__tests__/host-transfer-proxy-targeted.test.ts +6 -4
- package/src/__tests__/llm-resolver-override-or-default.test.ts +141 -0
- package/src/__tests__/media-stream-server-integration.test.ts +36 -0
- package/src/__tests__/stt-language-catalog-parity.test.ts +38 -0
- package/src/__tests__/subagent-tool-gate-mode.test.ts +1 -0
- package/src/__tests__/subagent-tools.test.ts +48 -92
- package/src/__tests__/tool-result-spool.test.ts +74 -18
- package/src/agent/loop.ts +6 -3
- package/src/calls/media-stream-server.ts +9 -1
- package/src/config/bundled-skills/settings/TOOLS.json +2 -2
- package/src/config/bundled-skills/settings/tools/voice-config-update.ts +1 -0
- package/src/config/bundled-skills/subagent/SKILL.md +3 -3
- package/src/config/bundled-skills/subagent/TOOLS.json +1 -1
- package/src/config/feature-flag-registry.json +0 -16
- package/src/config/llm-resolver.ts +41 -12
- package/src/config/schemas/stt.ts +10 -4
- package/src/context/post-turn-tool-result-truncation.ts +32 -16
- package/src/context/tool-result-spool.ts +32 -18
- package/src/daemon/conversation-tool-setup.ts +1 -1
- package/src/persistence/conversation-attention-store.ts +30 -10
- package/src/persistence/conversation-queries.ts +74 -1
- package/src/platform/managed-speech.test.ts +20 -0
- package/src/platform/managed-speech.ts +9 -0
- package/src/providers/speech-to-text/__tests__/resolve.test.ts +164 -6
- package/src/providers/speech-to-text/deepgram.ts +1 -0
- package/src/providers/speech-to-text/resolve.ts +80 -10
- package/src/providers/speech-to-text/vellum-managed.ts +7 -1
- package/src/providers/speech-to-text/vellum-speech-relay-connection.ts +3 -1
- package/src/runtime/auth/__tests__/guard-tests.test.ts +2 -0
- package/src/runtime/auth/__tests__/scopes.test.ts +20 -0
- package/src/runtime/auth/same-actor.ts +38 -7
- package/src/runtime/auth/scopes.ts +12 -0
- package/src/runtime/auth/types.ts +2 -0
- package/src/runtime/routes/__tests__/conversation-list-routes.test.ts +279 -1
- package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +14 -10
- package/src/runtime/routes/conversation-list-routes.ts +25 -0
- package/src/runtime/routes/conversation-query-routes.ts +0 -50
- package/src/stt/daemon-batch-transcriber.ts +8 -6
- package/src/tools/filesystem/read.ts +2 -2
- package/src/tools/host-filesystem/read.ts +14 -6
- package/src/tools/shared/filesystem/file-ops-service.ts +36 -3
- package/src/tools/subagent/spawn.ts +26 -78
- package/src/tools/types.ts +5 -3
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
import type { AssistantEvent } from "../../api/index.js";
|
|
4
|
-
import { isAssistantFeatureFlagEnabled } from "../../config/assistant-feature-flags.js";
|
|
5
4
|
import { validateInferenceProfileKey } from "../../config/inference-profile-validation.js";
|
|
6
|
-
import { resolveDefaultProfileKey } from "../../config/llm-resolver.js";
|
|
7
5
|
import { getConfig } from "../../config/loader.js";
|
|
8
6
|
import { profileSupportsTools } from "../../config/profile-tool-support.js";
|
|
9
7
|
import { findConversation } from "../../daemon/conversation-registry.js";
|
|
10
|
-
import {
|
|
11
|
-
getConversationOverrideProfile,
|
|
12
|
-
getMessages,
|
|
13
|
-
} from "../../persistence/conversation-crud.js";
|
|
8
|
+
import { getMessages } from "../../persistence/conversation-crud.js";
|
|
14
9
|
import {
|
|
15
10
|
countRecentSimilarSpawns,
|
|
16
11
|
normalizeSpawnObjective,
|
|
@@ -224,10 +219,7 @@ export async function executeSubagentSpawn(
|
|
|
224
219
|
// day buys the same answer twice, so the guard hands the repetition back to
|
|
225
220
|
// the caller with what it has already cost. It never blocks: `confirm_repeat`
|
|
226
221
|
// always spawns, and the advisor consult returned above is never guarded.
|
|
227
|
-
if (
|
|
228
|
-
isAssistantFeatureFlagEnabled("subagent-loop-guard") &&
|
|
229
|
-
parsed.confirm_repeat !== true
|
|
230
|
-
) {
|
|
222
|
+
if (parsed.confirm_repeat !== true) {
|
|
231
223
|
const guardResult = repeatSpawnGuardResult(
|
|
232
224
|
context.conversationId,
|
|
233
225
|
objective,
|
|
@@ -267,89 +259,45 @@ export async function executeSubagentSpawn(
|
|
|
267
259
|
};
|
|
268
260
|
}
|
|
269
261
|
|
|
270
|
-
//
|
|
271
|
-
//
|
|
272
|
-
//
|
|
273
|
-
//
|
|
274
|
-
//
|
|
275
|
-
//
|
|
276
|
-
// Resolution order: an explicit spawn-time profile, then the per-turn
|
|
277
|
-
// `context.overrideProfile` (populated by `runAgentLoopImpl` from its
|
|
278
|
-
// resolved `turnOverrideProfile`, covering per-conversation overrides and
|
|
279
|
-
// tool-routed switches), then a row read, and finally the resolved DEFAULT
|
|
280
|
-
// profile of the call site that invoked us. That last fallback is what makes
|
|
281
|
-
// a subagent match its invoker when the invoking turn ran purely on its
|
|
282
|
-
// call-site default — the workspace `activeProfile` for `mainAgent`, or the
|
|
283
|
-
// call site's own winning default (a `llm.callSites.<callSite>` pin or the
|
|
284
|
-
// catalog intent, e.g. `cost-optimized`) for a heartbeat/background
|
|
285
|
-
// invoker (`resolveDefaultProfileKey` runs the same winner selection as
|
|
286
|
-
// dispatch, minus a per-turn override).
|
|
262
|
+
// A subagent resolves the `subagentSpawn` call site's own default profile.
|
|
263
|
+
// A profile pinned on a conversation is a choice about that conversation,
|
|
264
|
+
// not about the work it delegates, and carrying it into a child would apply
|
|
265
|
+
// the pinned model's price and its tool-calling reliability to every spawn
|
|
266
|
+
// the turn makes.
|
|
287
267
|
//
|
|
288
|
-
//
|
|
289
|
-
//
|
|
290
|
-
//
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
// calls outside an agent-loop turn.
|
|
268
|
+
// Landing on the call site's own profile means passing NO override: the
|
|
269
|
+
// child already runs its loop under `callSite: "subagentSpawn"`, so the
|
|
270
|
+
// resolver picks that profile on its own. Passing it explicitly would select
|
|
271
|
+
// the same model but register as an override, and `resolveUsageAttribution`
|
|
272
|
+
// classifies an override winner as `conversation`, which would file every
|
|
273
|
+
// subagent's spend under a pin the caller never set and break the call-site
|
|
274
|
+
// breakdown this telemetry exists for.
|
|
296
275
|
//
|
|
297
|
-
// `
|
|
298
|
-
//
|
|
299
|
-
//
|
|
300
|
-
// model's price and its tool-calling reliability into every child the turn
|
|
301
|
-
// spawns. Under the flag a spawn that names no `inference_profile` resolves
|
|
302
|
-
// to the `subagentSpawn` call site's own default instead, and an explicit
|
|
303
|
-
// profile the catalog states cannot call tools falls back to that same
|
|
304
|
-
// default with a note on the result.
|
|
276
|
+
// An explicit `inference_profile` argument keeps `forceOverrideProfile` and
|
|
277
|
+
// wins outright, unless the catalog states it cannot call tools, in which
|
|
278
|
+
// case it falls back to the same default with a note on the result.
|
|
305
279
|
const config = getConfig();
|
|
306
280
|
const llm = config.llm;
|
|
307
|
-
const isolateProfile = isAssistantFeatureFlagEnabled(
|
|
308
|
-
"subagent-profile-isolation",
|
|
309
|
-
);
|
|
310
|
-
// Landing on the subagentSpawn call site's own profile means passing NO
|
|
311
|
-
// override: the child already runs its loop under `callSite: "subagentSpawn"`,
|
|
312
|
-
// so the resolver picks that profile on its own. Passing it explicitly would
|
|
313
|
-
// select the same model but register as an override, and
|
|
314
|
-
// `resolveUsageAttribution` classifies an override winner as `conversation`,
|
|
315
|
-
// which would file every isolated subagent's spend under a pin the caller
|
|
316
|
-
// never set and break the call-site breakdown this telemetry exists for.
|
|
317
281
|
|
|
318
282
|
let profileNote: string | undefined;
|
|
319
283
|
let inheritedOverrideProfile = requestedOverrideProfile;
|
|
320
284
|
if (inheritedOverrideProfile === undefined) {
|
|
321
285
|
if (outputContract === "verdict") {
|
|
322
286
|
// A verdict is a check rather than an investigation, so it takes the
|
|
323
|
-
// cheap tier
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
//
|
|
328
|
-
//
|
|
329
|
-
// this branch at all.
|
|
287
|
+
// cheap tier. The tier is this tool's preset, not a caller's choice, and
|
|
288
|
+
// an override outranks a call site's own profile under single-winner
|
|
289
|
+
// resolution, so the preset is only applied when the user pinned
|
|
290
|
+
// nothing: with an explicit `llm.callSites.subagentSpawn` profile the
|
|
291
|
+
// field is left unset and that pin wins. An `inference_profile` argument
|
|
292
|
+
// beats both and never enters this branch at all.
|
|
330
293
|
inheritedOverrideProfile =
|
|
331
294
|
llm.callSites?.subagentSpawn?.profile == null
|
|
332
295
|
? VERDICT_PROFILE_KEY
|
|
333
296
|
: undefined;
|
|
334
|
-
} else if (isolateProfile) {
|
|
335
|
-
// Isolation means the parent's pinned profile does not reach the child.
|
|
336
|
-
// Leaving this unset is what lands it on the subagentSpawn default.
|
|
337
|
-
inheritedOverrideProfile = undefined;
|
|
338
|
-
} else {
|
|
339
|
-
inheritedOverrideProfile =
|
|
340
|
-
context.overrideProfile ??
|
|
341
|
-
getConversationOverrideProfile(context.conversationId) ??
|
|
342
|
-
(llm.callSites?.subagentSpawn?.profile == null
|
|
343
|
-
? resolveDefaultProfileKey(
|
|
344
|
-
context.invokingCallSite ?? "mainAgent",
|
|
345
|
-
llm,
|
|
346
|
-
)
|
|
347
|
-
: undefined);
|
|
348
297
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
) {
|
|
298
|
+
// Every other spawn leaves this unset, which is what lands it on the
|
|
299
|
+
// subagentSpawn default rather than anything the parent turn was pinned to.
|
|
300
|
+
} else if (profileSupportsTools(inheritedOverrideProfile, config) === false) {
|
|
353
301
|
profileNote = `requested profile "${inheritedOverrideProfile}" is not verified for tool calling; ran on the default profile instead.`;
|
|
354
302
|
inheritedOverrideProfile = undefined;
|
|
355
303
|
forceOverrideProfile = false;
|
package/src/tools/types.ts
CHANGED
|
@@ -435,10 +435,12 @@ export interface ToolContext {
|
|
|
435
435
|
invokingCallSite?: LLMCallSite;
|
|
436
436
|
/**
|
|
437
437
|
* Canonical principal ID of the actor on whose behalf this tool invocation
|
|
438
|
-
* is running
|
|
438
|
+
* is running — the turn's actor principal, falling back to the trust
|
|
439
|
+
* context's `guardianPrincipalId` (see `resolveTurnActorPrincipalId`).
|
|
439
440
|
* Used by host proxies to bind cross-client targeted execution to the same
|
|
440
|
-
* authenticated user identity
|
|
441
|
-
* with
|
|
441
|
+
* authenticated user identity, so it must resolve to the SAME principal a
|
|
442
|
+
* desktop client registers with on its SSE stream. May be undefined for
|
|
443
|
+
* legacy/internal flows with no resolved actor identity.
|
|
442
444
|
* @legacy
|
|
443
445
|
*/
|
|
444
446
|
sourceActorPrincipalId?: string;
|