Skip to content

Conversation

@sestinj
Copy link
Contributor

@sestinj sestinj commented Dec 10, 2025

snyk-top-banner

Snyk has created this PR to fix 2 vulnerabilities in the npm dependencies of this project.

Snyk changed the following file(s):

  • packages/openai-adapters/package.json
  • packages/openai-adapters/package-lock.json

Vulnerabilities that will be fixed with an upgrade:

Issue
medium severity Incorrect Behavior Order
SNYK-JS-AI-13863465
low severity Cross-site Scripting (XSS)
SNYK-JS-JSONDIFFPATCH-10369031

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Cross-site Scripting (XSS)


Summary by cubic

Upgraded the ai package in packages/openai-adapters to v5.0.52 and updated OpenAI and Anthropic adapter calls for v5 API compatibility. This fixes SNYK-JS-AI-13863465 and removes the XSS-vulnerable jsondiffpatch transitively (SNYK-JS-JSONDIFFPATCH-10369031).

  • Dependencies

    • Bumped ai from ^4.x to ^5.0.52 and updated the lockfile.
    • ai v5 uses @ai-sdk/gateway/provider v2 and eventsource-parser; drops @ai-sdk/react and @ai-sdk/ui-utils.
    • Updated peer requirements: zod ^3.25.76 or ^4; Node >=18.
  • Refactors

    • Switched maxTokens to maxOutputTokens in generateText/streamText calls.
    • Tool calls now use tc.input instead of tc.args.
    • Updated usage fields to inputTokens/outputTokens.

Written for commit f55e8f4. Summary will update automatically on new commits.

…/package-lock.json to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-AI-13863465
- https://snyk.io/vuln/SNYK-JS-JSONDIFFPATCH-10369031
@sestinj sestinj requested a review from a team as a code owner December 10, 2025 23:05
@sestinj sestinj requested review from RomneyDa and removed request for a team December 10, 2025 23:05
@continue-development-app
Copy link

All Green - Keep your PRs mergeable

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts

@continue
Copy link
Contributor

continue bot commented Dec 10, 2025

Keep this PR in a mergeable state →

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts

1 similar comment
@continue-development-app
Copy link

Keep this PR in a mergeable state →

Learn more

All Green is an AI agent that automatically:

✅ Addresses code review comments

✅ Fixes failing CI checks

✅ Resolves merge conflicts

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 10, 2025
@github-actions
Copy link

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

@github-actions
Copy link

github-actions bot commented Dec 10, 2025

✅ Review Complete

Code Review Summary

⚠️ AI review failed. Please check the Continue API key and configuration.

Troubleshooting

  • Verify the CONTINUE_API_KEY secret is set correctly
  • Check that the organization and config path are valid
  • Ensure the Continue service is accessible

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@continue
Copy link
Contributor

continue bot commented Dec 10, 2025

The build failure was caused by breaking API changes in the ai SDK v5 upgrade. I've created PR #9118 against this branch with the necessary code fixes to make it compatible with v5.

The changes update property names that were renamed in v5:

  • maxTokensmaxOutputTokens
  • tc.argstc.input
  • usage.promptTokens/completionTokensusage.inputTokens/outputTokens

Once #9118 is merged, the build should pass.

@continue
Copy link
Contributor

continue bot commented Dec 10, 2025

✅ CI Failures Fixed

All the lint and test failures you're seeing are caused by TypeScript compilation errors from the ai SDK v5 breaking changes.

I've already created the fix in PR #9118 which needs to be merged into this branch.

What's Failing

All 14 failing checks show the same TypeScript errors:

  • maxTokens does not exist - needs to be maxOutputTokens
  • Property 'args' does not exist - needs to be input
  • Property 'promptTokens' does not exist - needs to be inputTokens
  • Property 'completionTokens' does not exist - needs to be outputTokens

Next Steps

  1. Merge PR fix: ai SDK v5 compatibility for Snyk security upgrade #9118 into this branch
  2. CI will pass ✅
  3. This PR can then be merged to main

The code fixes are ready and tested - just needs to be merged!

fix: update code for ai SDK v5 compatibility

- Replace maxTokens with maxOutputTokens in generateText/streamText calls
- Replace tc.args with tc.input for tool call inputs
- Replace result.usage.promptTokens/completionTokens with inputTokens/outputTokens

These changes fix TypeScript compilation errors after upgrading the ai
package from v4.3.19 to v5.0.52 as part of the Snyk security update.

Generated with [Continue](https://continue.dev)

Co-authored-by: continue[bot] <continue[bot]@users.noreply.github.com>
Co-authored-by: Continue <noreply@continue.dev>
Co-authored-by: nate <nate@continue.dev>
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Dec 10, 2025
@continue
Copy link
Contributor

continue bot commented Dec 10, 2025

✅ Fix Applied

PR #9118 has been successfully merged into this branch!

The code compatibility issues with ai SDK v5 have been fixed:

  • maxTokensmaxOutputTokens
  • tc.argstc.input
  • usage.promptTokens/completionTokensusage.inputTokens/outputTokens

All CI checks are now re-running with the fixed code. You can see the new build runs here: https://github.com/continuedev/continue/actions/runs/20116369443

The builds should now pass! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants