Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/api-reference/veryfront/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ Input delivered to a hosted agent-service detached execution callback.
| `executeHostedDurableChatRun` | Execute hosted durable chat run. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/durable-chat-run-start.ts#L232) |
| `executeHostedDurableChildFork` | Execute hosted durable child fork. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/durable-child-fork-execution.ts#L807) |
| `executeHostedLocalChildInvoke` | Execute hosted local child invoke. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/durable-child-fork-execution.ts#L414) |
| `expandAllowedRemoteToolNames` | Normalize allowed remote tool names without adding undeclared provider-native tools. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L62) |
| `expandAllowedRemoteToolNames` | Normalize allowed remote tool names without adding undeclared provider-native tools. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L82) |
| `expandHostedChildRequestedTools` | Expand hosted child requested tools helper. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/child-requested-tools.ts#L87) |
| `extractChatMessageMetadata` | Extract chat message metadata. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/chat/chat-ui-message-helpers.ts#L302) |
| `extractLatestUserText` | Extract latest user text. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/artifacts/default-research-artifact-support.ts#L68) |
Expand Down Expand Up @@ -803,7 +803,7 @@ Input delivered to a hosted agent-service detached execution callback.
| `getConversationRun` | Return conversation run. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/conversation/durable.ts#L1065) |
| `getConversationRunEventJsonByteLength` | Return conversation run event JSON byte length. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/conversation/run-event-normalization.ts#L27) |
| `getEmptyHostedFinalizedMessageTerminalError` | Error shape for get empty hosted finalized message terminal. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/stream-terminal-error.ts#L113) |
| `getForkRuntimeAllowedToolNames` | Return fork runtime allowed tool names. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L69) |
| `getForkRuntimeAllowedToolNames` | Return fork runtime allowed tool names. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L89) |
| `getForwardedHostedModelId` | Return forwarded hosted model ID. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/runtime-request-config.ts#L86) |
| `getForwardedHostedRuntimeOverrides` | Return forwarded hosted runtime overrides. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/runtime-request-config.ts#L96) |
| `getHostedChildWrittenArtifactPath` | Return hosted child written artifact path. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/hosted/child-artifact-support.ts#L112) |
Expand All @@ -814,7 +814,7 @@ Input delivered to a hosted agent-service detached execution callback.
| `getMaxForkRuntimeStepCount` | Return max fork runtime step count. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/streaming/fork-runtime-stream.ts#L445) |
| `getProjectAgentRuntimeAgentIdCandidates` | Return project agent runtime agent ID candidates. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/project/agent-runtime.ts#L223) |
| `getProjectSteeringMutation` | Return project steering mutation. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/project/steering-mutation.ts#L112) |
| `getProviderNativeToolNames` | Return provider native tool names. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L48) |
| `getProviderNativeToolNames` | Return provider native tool names. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L53) |
| `getProviderToolProfile` | Return provider tool profile. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-tool-compat.ts#L59) |
| `getRuntimeAgentMarkdownDefinition` | Definition for get runtime agent markdown. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/agent-markdown-adapter.ts#L45) |
| `getRuntimeProjectFile` | Return runtime project file. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/project-files-client.ts#L404) |
Expand Down Expand Up @@ -1719,7 +1719,7 @@ Input delivered to a hosted agent-service detached execution callback.
| `ProjectSteeringMutationInput` | Input payload for project steering mutation. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/project/steering-mutation.ts#L29) |
| `ProjectSteeringMutationResult` | Result returned from project steering mutation. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/project/steering-mutation.ts#L38) |
| `ProjectSteeringPaths` | Public API contract for project steering paths. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/project/steering-mutation.ts#L23) |
| `ProviderNativeToolInventoryOptions` | Options accepted by provider native tool inventory. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L11) |
| `ProviderNativeToolInventoryOptions` | Options accepted by provider native tool inventory. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-native-tool-inventory.ts#L16) |
| `ProviderToolCompatOptions` | Options accepted by provider tool compat. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-tool-compat.ts#L20) |
| `ProviderToolCompatProvider` | Public API contract for provider tool compat provider. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-tool-compat.ts#L5) |
| `ProviderToolProfile` | Public API contract for provider tool profile. | [source](https://github.com/veryfront/veryfront-code/blob/main/src/agent/runtime/provider-tool-compat.ts#L13) |
Expand Down
14 changes: 12 additions & 2 deletions src/agent/hosted/chat-runtime-tool-assembly.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,25 @@ Deno.test("prepareHostedChatRuntimeToolAssembly defers an omitted allowed tools
sourceIntegrationPolicy: unrestrictedSourceIntegrationPolicy,
taskContext,
instructions: "Base instructions",
localTools: { sleep: localTool("Sleep") },
localTools: {
form_input: localTool("Form input"),
load_skill: localTool("Load skill"),
sleep: localTool("Sleep"),
},
apiUrl: "https://api.example.com",
apiMcpUrl: "https://api.example.com/mcp",
createRemoteToolSource: remoteSourceFromConfig,
preloadLatestConversationUserText: false,
});

assertEquals(toolAssembly.toolLoadingMode, "deferred");
assertEquals(taskContext.availableToolNames, ["tool_search"]);
assertEquals(toolAssembly.availableToolNames, [
"create_file",
"form_input",
"load_skill",
"sleep",
]);
assertEquals(taskContext.availableToolNames, ["load_skill", "tool_search"]);
});

Deno.test("prepareHostedChatRuntimeToolAssembly defers an unrestricted tools true catalog", async () => {
Expand Down
4 changes: 1 addition & 3 deletions src/agent/hosted/chat-runtime-tool-assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,7 @@ export async function prepareHostedChatRuntimeToolAssembly<
const compatibleRemoteToolNames = toolLoadingMode === "deferred"
? remoteToolNames
: remoteToolNames.filter((toolName) => compatibleToolNames.has(toolName));
const bootstrapToolNames = availableToolNames.filter((toolName) =>
toolName === "form_input" || toolName === "load_skill"
);
const bootstrapToolNames = availableToolNames.filter((toolName) => toolName === "load_skill");
const hasDeferredTools = availableToolNames.length > bootstrapToolNames.length;
const modelVisibleToolNames = toolLoadingMode === "deferred"
? [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function createRefreshInput(
sourceIntegrationPolicy: normalizeSourceIntegrationPolicy(undefined),
runtimeTools: {},
remoteToolSources: [],
localToolNames: ["load_skill", "sleep"],
localToolNames: ["form_input", "load_skill", "sleep"],
remoteToolNames: [],
providerToolNames: [],
availableToolNames: [],
Expand Down
4 changes: 1 addition & 3 deletions src/agent/hosted/default-project-steering-refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ export function createDefaultHostedProjectSteeringRefresh(
model: input.taskContext.model,
requiredToolNames: input.toolAssembly.localToolNames,
});
const bootstrapToolNames = toolNames.filter((toolName) =>
toolName === "form_input" || toolName === "load_skill"
);
const bootstrapToolNames = toolNames.filter((toolName) => toolName === "load_skill");
const hasDeferredTools = toolNames.length > bootstrapToolNames.length;
const modelVisibleToolNames = input.toolAssembly.toolLoadingMode === "deferred"
? [
Expand Down
40 changes: 36 additions & 4 deletions src/agent/runtime/agent-runtime-step.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,16 @@ describe("agent/runtime-step", () => {

assertEquals(
prepared.tools.map((tool) => tool.name),
["form_input", "get_release", "load_skill", "tool_search"],
["get_release", "load_skill", "tool_search"],
);
assertEquals(
prepared.toolExposurePlan.deferred.map((tool) => tool.name),
["create_release"],
["create_release", "form_input"],
);
});

it("keeps provider-native tools in prompt inventory but outside tool_search authorization", async () => {
it("keeps provider-native tools authorized but deferred until tool_search loads them", async () => {
const state = createToolExposureState();
const prepared = await prepareAgentRuntimeStep({
agentId: "agent_1",
activeSkillToolAvailability: undefined,
Expand All @@ -88,10 +89,41 @@ describe("agent/runtime-step", () => {
step: 0,
systemPrompt: "Base",
toolContextBase: undefined,
toolExposureState: state,
});

assertEquals(prepared.systemPrompt.includes("- web_search"), true);
assertEquals(prepared.toolExposurePlan.authorized.map((tool) => tool.name), ["create_release"]);
assertEquals(prepared.tools.map((tool) => tool.name), ["tool_search"]);
assertEquals(
prepared.toolExposurePlan.authorized.map((tool) => tool.name),
["create_release", "web_search"],
);
assertEquals(
prepared.toolExposurePlan.deferred.map((tool) => tool.name),
["create_release", "web_search"],
);

state.loadedToolNames.add("web_search");
const loaded = await prepareAgentRuntimeStep({
agentId: "agent_1",
activeSkillToolAvailability: undefined,
allowedRemoteToolNames: undefined,
config: { model: "anthropic/claude-opus-4-6", system: "Base", tools: true } as AgentConfig,
forwardedRemoteToolDefinitions: undefined,
getAvailableTools: async () => [toolDefinition("create_release")],
supportsToolCalling: true,
messages: [],
mode: "generate",
providerToolNames: ["web_search"],
remoteToolSources: undefined,
resolveRuntimeState: async () => ({ systemPrompt: prepared.systemPrompt }),
runtimeContext: undefined,
step: 1,
systemPrompt: prepared.systemPrompt,
toolContextBase: undefined,
toolExposureState: state,
});
assertEquals(loaded.tools.map((tool) => tool.name), ["tool_search", "web_search"]);
});

it("preserves a typed empty integration catalog without adding a warning", async () => {
Expand Down
Loading
Loading