-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: tools package strict mode for openai models #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: tools package strict mode for openai models #699
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| 🔵 In progress View logs |
supermemory-app | ea1f232 | Jan 23 2026, 03:10 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ⛔ Deployment terminated View logs |
supermemory-app | 0853bc8 | Jan 23 2026, 03:37 AM |
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
1 similar comment
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Merge activity
|
ea1f232 to
0853bc8
Compare
| * Enable strict schema mode for OpenAI strict validation. | ||
| * When true, all schema properties are required (satisfies OpenAI strict mode). | ||
| * When false (default), optional fields remain optional for maximum compatibility. | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The strict configuration option is ignored by the OpenAI tools in openai/tools.ts. The schema remains static, not enforcing required fields as expected.
Severity: HIGH
Suggested Fix
Modify the OpenAI tools in packages/tools/src/openai/tools.ts to dynamically generate the tool schema based on the strict flag in the configuration. This involves changing memoryToolSchemas from a hardcoded constant to a function that accepts the config and adjusts the required fields array accordingly, ensuring consistent behavior with the AI SDK implementation.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: packages/tools/src/types.ts#L19-L22
Potential issue: The `strict` configuration option, added to `SupermemoryToolsConfig`,
is correctly implemented for the AI SDK tools but is silently ignored by the OpenAI
tools in `packages/tools/src/openai/tools.ts`. Functions like `createSearchMemoriesTool`
accept a `config` object but use a hardcoded schema that does not become stricter when
`config.strict` is `true`. This leads to a discrepancy where users enabling strict mode
for OpenAI tools will not get the expected schema validation, causing potential runtime
validation errors with services like OpenAI's strict mode, contrary to the feature's
documented purpose.
Did we get this right? 👍 / 👎 to inform future reviews.

No description provided.