feat(FN-3713): add web builtin tool opt-in for AI agents

Added agent permission policy model with persistence in core, and wired web-builtin tool opt-in enabling planning and synthesis web tools in the dashboard with corresponding docs and a changeset. Also added an inline fast-mode toggle wired into peer executor state, retry logic for cluster task-ID ov

Fusion-Task-Id: FN-3713
This commit is contained in:
Fusion
2026-05-07 12:03:33 -07:00
committed by gsxdsm
parent 51c6ddb9a5
commit 81da75f661
10 changed files with 83 additions and 3 deletions

View File

@@ -361,6 +361,18 @@ describe("planning module", () => {
expect(session?.agent).toBeDefined();
});
it("passes builtin web tool allowlist when creating non-streaming planning agent", async () => {
const createFnAgentSpy = vi.fn(async () => createMockAgent(STANDARD_QUESTION_RESPONSES));
__setCreateFnAgent(createFnAgentSpy as any);
await createSession(getUniqueIp(), initialPlan, undefined, TEST_ROOT_DIR);
expect(createFnAgentSpy).toHaveBeenCalledWith(expect.objectContaining({
tools: "readonly",
builtinToolsAllowlist: ["WebSearch", "WebFetch"],
}));
});
it("cleans up session on agent failure", async () => {
__setCreateFnAgent(async () => {
throw new Error("Agent creation failed");
@@ -447,6 +459,7 @@ describe("planning module", () => {
const callArg = createFnAgentSpy.mock.calls[0]?.[0] as Record<string, unknown>;
expect(callArg?.defaultProvider).toBeUndefined();
expect(callArg?.defaultModelId).toBeUndefined();
expect(callArg?.builtinToolsAllowlist).toEqual(["WebSearch", "WebFetch"]);
});
it("uses custom prompt from promptOverrides when provided", async () => {