fix(omp): expose injected Paseo tools directly (#2418)

This commit is contained in:
Derek Perez
2026-07-27 14:44:25 -07:00
committed by GitHub
parent e59c94812b
commit 5bd317205c
4 changed files with 16 additions and 2 deletions

View File

@@ -128,7 +128,7 @@ class OmpHostToolHarness {
}
describe("OMP host tools", () => {
test("serializes the caller-scoped Paseo catalog for set_host_tools", () => {
test("marks every caller-scoped Paseo tool essential for direct invocation", () => {
const catalog = createCatalog([
{
name: "create_agent",
@@ -137,6 +137,11 @@ describe("OMP host tools", () => {
inputSchema: { initialPrompt: z.string().describe("Prompt for the new agent.") },
handler: async () => ({ content: [] }),
},
{
name: "browser_list_tabs",
description: "List browser tabs.",
handler: async () => ({ content: [] }),
},
]);
expect(serializeOmpHostTools(catalog)).toEqual([
@@ -144,8 +149,15 @@ describe("OMP host tools", () => {
name: "create_agent",
label: "Create agent",
description: "Create a Paseo agent.",
loadMode: "essential",
parameters: expect.objectContaining({ type: "object", required: ["initialPrompt"] }),
},
{
name: "browser_list_tabs",
description: "List browser tabs.",
loadMode: "essential",
parameters: expect.objectContaining({ type: "object" }),
},
]);
});

View File

@@ -35,6 +35,7 @@ export function serializeOmpHostTools(catalog: PaseoToolCatalog): OmpRpcHostTool
const definition: OmpRpcHostToolDefinition = {
name: tool.name,
description: tool.description,
loadMode: "essential",
parameters: serializePaseoToolInputParameters(tool),
};
if (tool.title) {

View File

@@ -178,6 +178,7 @@ export const OmpRpcHostToolDefinitionSchema = z
name: z.string(),
label: z.string().optional(),
description: z.string(),
loadMode: z.enum(["essential", "discoverable"]).optional(),
parameters: z.record(z.string(), z.unknown()),
hidden: z.boolean().optional(),
})