Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
5 changes: 5 additions & 0 deletions .changeset/lucky-candles-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fake-scope/fake-pkg": patch
---

fix: add default value to grep tool glob schema for strict mode compatibility
19 changes: 19 additions & 0 deletions libs/deepagents/src/middleware/fs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,25 @@ describe("createFilesystemMiddleware", () => {
expect(parsed.file_path).toBe("/app/test.c");
expect(parsed.content).toBe("");
});

it("all tool schema properties should be included in the required array", () => {
const middleware = createFilesystemMiddleware({
backend: () => createMockBackend(),
});

for (const t of middleware.tools!) {
const jsonSchema = (t as any).schema.toJSONSchema();
const properties = Object.keys(jsonSchema.properties ?? {});
const required = jsonSchema.required ?? [];

for (const prop of properties) {
expect(
required,
`tool "${(t as any).name}" is missing "${prop}" in required`,
).toContain(prop);
}
}
});
});

describe("tool result truncation integration", () => {
Expand Down
1 change: 1 addition & 0 deletions libs/deepagents/src/middleware/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ function createGrepTool(
.string()
.optional()
.nullable()
.default(null)
.describe("Optional glob pattern to filter files (e.g., '*.py')"),
}),
},
Expand Down
Loading