fix: address Copilot review round 40 — a required name counts as a field
A schema may require a property it never declares: `{ type: "object",
required: ["token"] }` is legal and the tool plainly takes an argument.
declaresAnyFields counted only `properties`, so an App tool shaped that way —
including nested under a composition — was reported input-free and
auto-invoked with `{}`.
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
48651956e5
commit
8f935adaad
1 changed files with 25 additions and 0 deletions
|
|
@ -145,6 +145,12 @@ describe("hasInputFields with root composition (#2123)", () => {
|
|||
).toBe(true);
|
||||
});
|
||||
|
||||
it("counts a required name the schema never declares", () => {
|
||||
expect(hasInputFields(tool({ type: "object", required: ["token"] }))).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("still reports no fields for a bare object schema", () => {
|
||||
expect(hasInputFields(tool({ type: "object" }))).toBe(false);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue