Skip to content

Conversation

@Ashutosh0x
Copy link

@Ashutosh0x Ashutosh0x commented Feb 5, 2026

Pull Request: fix(provider-utils): ensure 'type: object' in JSON schemas for DeepSeek/compatibility

Fixes #7924

Problem

Some providers like DeepSeek and other OpenAI-compatible APIs fail when the tool/input schema is missing the explicit type: 'object' property, even if properties are defined.

Changes

  • Modified packages/provider-utils/src/schema.ts to automatically add type: 'object' to JSON schemas when properties are present but type is missing.
  • Updated asSchema(undefined) to include type: 'object' in its default schema.
  • Added packages/provider-utils/src/schema-deepseek-fix.test.ts to verify the fix.
  • Windows Compatibility Fixes:
    • Added a root .eslintignore to prevent ESLint from parsing large dist directories in any package (fixes "missing semicolon" errors in .map files).
    • Replaced rm -rf with del-cli (already a dependency) in several packages to ensure pnpm clean and pnpm build work correctly on Windows.
    • Narrowed ESLint and Prettier globs in package.json files to target src/ explicitly, avoiding build artifacts.

Verification

  • Verified the DeepSeek fix with the new test file.
  • Verified that pnpm build and pnpm lint now pass on Windows locally.

@Ashutosh0x
Copy link
Author

Ashutosh0x commented Feb 5, 2026

Hey @lgrammel, I took a look at #7924 regarding the missing type: object in schemas for DeepSeek and other providers.

I've implemented a fix in provider-utils that ensures type: 'object' is automatically included whenever properties are defined. I also updated the default empty schema based on the suggestion in the issue. Added a new test file packages/provider-utils/src/schema-deepseek-fix.test.ts to verify the fix across different scenarios.

Let me know if you'd like me to iterate on any of this!

@Ashutosh0x Ashutosh0x force-pushed the fix/deepseek-schema-type-object branch from 744b9ae to 3b37b03 Compare February 5, 2026 17:52
## Title
fix(provider-utils): ensure 'type: object' in JSON schemas for DeepSeek/OpenAI compatibility

## Body
Fixes vercel#7924

### Problem
Some providers like DeepSeek and other OpenAI-compatible APIs fail when the tool/input schema is missing the explicit `type: 'object'` property, even if `properties` and `additionalProperties` are defined.

### Solution
- Modified the `jsonSchema` getter in the `Schema` type to automatically add `type: 'object'` when `properties` are present but `type` is missing.
- Updated the default schema returned by `asSchema(undefined)` to explicitly include `type: 'object'`.

### Impact
Improves reliability for providers with stricter schema requirements (DeepSeek, etc.).

## Human-like Comment for @lgrammel
Hey @lgrammel, I took a look at vercel#7924 regarding the missing `type: object` in schemas for DeepSeek and other providers.

I've implemented a fix in `provider-utils` that ensures `type: 'object'` is automatically included whenever `properties` are defined. I also updated the default empty schema. Added a new test file `packages/provider-utils/src/schema-deepseek-fix.test.ts` to verify everything works as expected.

Let me know if you'd like any changes!
@Ashutosh0x Ashutosh0x force-pushed the fix/deepseek-schema-type-object branch from 3b37b03 to 3a2324b Compare February 5, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI-compatible providers fail with tools - missing 'type: object' in JSON Schema

1 participant