[PR #422] [MERGED] fix: add default value to grep tool glob schema for strict mode compatibility #447

Closed
opened 2026-06-05 17:23:07 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/422
Author: @JadenKim-dev
Created: 4/2/2026
Status: Merged
Merged: 4/3/2026
Merged by: @christian-bromann

Base: mainHead: fix/grep-tool-schema-default


📝 Commits (3)

  • 84961e3 fix: add default value to grep tool glob schema for strict mode compatibility
  • a384766 Fix grep tool glob schema for strict mode
  • 1961aa2 Update .changeset/lucky-candles-reply.md

📊 Changes

3 files changed (+25 additions, -0 deletions)

View changed files

.changeset/lucky-candles-reply.md (+5 -0)
📝 libs/deepagents/src/middleware/fs.test.ts (+19 -0)
📝 libs/deepagents/src/middleware/fs.ts (+1 -0)

📄 Description

Summary

  • The grep tool's glob field was defined with .optional().nullable() but without .default(),
    causing it to be excluded from the JSON schema required array.
  • This violates OpenAI's strict mode requirement that all properties must be listed in required,
    resulting in a 400 error when using providerStrategy with OpenAI models.
  • Added .default(null) to the glob field and a test verifying all tool schema properties
    are included in required.

Fixes #401

Test plan

  • Existing fs.test.ts tests pass (54 tests)
  • New test verifies all tool schema properties are in the required array
  • Confirmed the fix produces correct JSON schema output (glob included in required)
  • Confirmed the old schema (without .default(null)) would fail the new test

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/422 **Author:** [@JadenKim-dev](https://github.com/JadenKim-dev) **Created:** 4/2/2026 **Status:** ✅ Merged **Merged:** 4/3/2026 **Merged by:** [@christian-bromann](https://github.com/christian-bromann) **Base:** `main` ← **Head:** `fix/grep-tool-schema-default` --- ### 📝 Commits (3) - [`84961e3`](https://github.com/langchain-ai/deepagentsjs/commit/84961e3b18b47a7b6ecd93e6eb7ec3391f81424a) fix: add default value to grep tool glob schema for strict mode compatibility - [`a384766`](https://github.com/langchain-ai/deepagentsjs/commit/a38476653db9f6de8d0bf9b6d3c0fb9dbcb6d382) Fix grep tool glob schema for strict mode - [`1961aa2`](https://github.com/langchain-ai/deepagentsjs/commit/1961aa2397a77e7818ea17b0fde57a8881c4b51c) Update .changeset/lucky-candles-reply.md ### 📊 Changes **3 files changed** (+25 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/lucky-candles-reply.md` (+5 -0) 📝 `libs/deepagents/src/middleware/fs.test.ts` (+19 -0) 📝 `libs/deepagents/src/middleware/fs.ts` (+1 -0) </details> ### 📄 Description ## Summary - The grep tool's `glob` field was defined with `.optional().nullable()` but without `.default()`, causing it to be excluded from the JSON schema `required` array. - This violates OpenAI's strict mode requirement that all properties must be listed in `required`, resulting in a 400 error when using `providerStrategy` with OpenAI models. - Added `.default(null)` to the `glob` field and a test verifying all tool schema properties are included in `required`. Fixes #401 ## Test plan - [x] Existing fs.test.ts tests pass (54 tests) - [x] New test verifies all tool schema properties are in the `required` array - [x] Confirmed the fix produces correct JSON schema output (`glob` included in `required`) - [x] Confirmed the old schema (without `.default(null)`) would fail the new test --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:23:07 -04:00
yindo closed this issue 2026-06-05 17:23:07 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#447