Skip to content

Commit 0edf5ee

Browse files
RVZO6claude
andcommitted
test(server): a thread's call of a hidden-outside tool reaches its handler
The HTTP test listed tools as a thread but only called one as an outside client. Call preview_status over HTTP as both: the thread gets the handler's own preview-capability refusal, and the outside client gets "not found". Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent bd0fd6e commit 0edf5ee

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎apps/server/src/provider/AgentContextBudget.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,19 @@ it.effect("offers a thread its own tools and an outside client none of them", ()
260260
expect(refused).toMatchObject({
261261
error: { message: expect.stringContaining("request_secret") },
262262
});
263+
264+
// A thread call of a hidden-outside tool reaches its handler. This thread lacks the
265+
// preview capability, so the handler's own refusal proves the call got past discovery.
266+
const previewCall = { name: "preview_status", arguments: {} };
267+
expect(yield* asThread("tools/call", previewCall)).toMatchObject({
268+
result: {
269+
isError: true,
270+
content: [{ text: expect.stringContaining("does not grant the preview capability") }],
271+
},
272+
});
273+
expect(yield* asOutside("tools/call", previewCall)).toMatchObject({
274+
error: { message: "Tool 'preview_status' not found" },
275+
});
263276
}),
264277
).pipe(Effect.provide(NodeHttpServer.layerTest)),
265278
);

0 commit comments

Comments
 (0)