Skip to content

fix(deps): upgrade ai-sdk provider family and force-patch @hono/node-server#217

Merged
jithin23-kv merged 4 commits into
masterfrom
fix/ai-sdk-mcp-sdk-audit
Jul 23, 2026
Merged

fix(deps): upgrade ai-sdk provider family and force-patch @hono/node-server#217
jithin23-kv merged 4 commits into
masterfrom
fix/ai-sdk-mcp-sdk-audit

Conversation

@jithin23-kv

@jithin23-kv jithin23-kv commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves the remaining Dependabot-flagged vulnerabilities that couldn't be fixed by a plain npm audit fix:

  • @ai-sdk/anthropic, @ai-sdk/google, @ai-sdk/openai, @ai-sdk/openai-compatible: bumped from 2.x/1.x to the ai-v6-tagged 3.x/2.x releases (matching the major generation our ai@^6.0.0 dependency already uses), which resolves the @ai-sdk/provider-utils uncontrolled resource consumption issue (GHSA-866g-f22w-33x8). Deliberately chosen over npm audit fix --force, which would have jumped two majors to 4.x and also silently downgraded @anthropic-ai/claude-agent-sdk.
  • @hono/node-server: added an overrides entry pinning it to ^2.0.5, since @modelcontextprotocol/sdk's own declared range (^1.19.9) excludes the patched 2.x line (GHSA-frvp-7c67-39w9). Verified this package isn't even reachable in our own code paths (we use StdioServerTransport/StreamableHTTPClientTransport, not the MCP SDK's HTTP-server transport that pulls this in), so risk was already low — this closes the alert regardless.

Follow-up cleanup in core/src/providers/factory.ts: removed the global AI_SDK_LOG_WARNINGS = false suppression. It existed only because the old @ai-sdk/openai-compatible@1.x implemented an older provider spec than ai@6 and warned on every model instance. With the v2 bump in this PR that mismatch is gone, so the suppression is now dead code (and its comment stale) — dropping it also stops silently muting genuine AI SDK warnings for all other providers.

Follow-up cleanup in runners/cli/package.json: dropped the 9 @ai-sdk/*, ai, yaml and zod entries that were duplicated from core. These are already runtime dependencies of @keyvaluesystems/agent-opfor-core, which the CLI bundle inlines via esbuild (they resolve from the hoisted install), and the CLI's own source imports none of them directly — re-declaring them only forced the version bumps above to be made in two places. Kept the CLI's direct imports, build tooling, and core's optional @anthropic-ai/* peer deps. This aligns the CLI with how the MCP/SDK runners already work. Verified with a clean npm run build, npm run typecheck, and an opfor smoke run.

Also includes an unrelated stray version sync in runners/cli/ui/package-lock.json (0.10.0 → 0.10.1) picked up during the dependency install.

Resolves: https://github.com/KeyValueSoftwareSystems/agent-opfor/security/dependabot/59, https://github.com/KeyValueSoftwareSystems/agent-opfor/security/dependabot/65, https://github.com/KeyValueSoftwareSystems/agent-opfor/security/dependabot/20

Test plan

  • npm run build, npm run typecheck, npm run lint, npm run format:check all pass
  • npm test passes (163/163) — re-verified after removing the warning suppression; providerFactory tests instantiate the groq + openai-compatible models and no AI SDK Warning line surfaces
  • npm audit — down to 1 pre-existing low-severity, unfixable-without-breaking issue (esbuild, pinned by tsx)
  • Manually verified opfor run end-to-end with openai and openai-compatible attacker LLMs
  • Manually verified opfor hunt (autonomous mode)
  • Manually verified opfor run against a live MCP target (remote server)
  • Manually verified opfor's own MCP server (stdio initialize + tools/list) responds correctly
  • anthropic/google attacker LLM providers verified by typecheck only (no live call) — no test API keys available for this pass; recommend a live smoke test by someone with those keys before/after merge

Summary by CodeRabbit

  • Chores
    • Upgraded AI provider integration packages to newer versions across the project for better compatibility and access to recent models.
    • Standardized the resolved version of the node server package using an override to keep runtime behavior consistent.
    • Refreshed command-line tooling dependencies to match the updated provider integrations.
  • Bug Fixes
    • Re-enabled provider spec-compatibility warnings so compatibility issues are surfaced instead of being hidden.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Updated AI SDK dependency ranges in core, removed obsolete AI SDK-related CLI development dependencies, added a root override for @hono/node-server, and removed suppression of AI SDK specification compatibility warnings in the provider factory.

Changes

Dependency and SDK warning updates

Layer / File(s) Summary
Update AI SDK dependencies
core/package.json, runners/cli/package.json
Updated four AI SDK ranges in core and removed AI SDK, ai, yaml, and zod from CLI development dependencies.
Restore provider compatibility warnings
core/src/providers/factory.ts
Removed the global setting that disabled AI SDK specification compatibility warnings.
Pin Hono node server version
package.json
Added a root override forcing @hono/node-server to use ^2.0.5.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main dependency upgrade and Hono override change.
Description check ✅ Passed It includes the problem, solution, changes, issue links, and test plan; screenshots are the only missing optional section.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ai-sdk-mcp-sdk-audit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 48-50: Update the package.json overrides entry for
`@hono/node-server` to remain within the `@modelcontextprotocol/sdk-supported`
^1.19.9 range, or add an MCP integration test that validates compatibility with
the 2.x override; do not retain the current unsupported override without
coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 26abeb00-14ca-4285-b324-64e9cae84c71

📥 Commits

Reviewing files that changed from the base of the PR and between 338f98b and 90860df.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • runners/cli/ui/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • core/package.json
  • package.json
  • runners/cli/package.json

Comment thread package.json
…tible is on-spec

The `@ai-sdk/openai-compatible` bump in this PR (v1 -> v2, LanguageModelV2/V3)
aligns it with ai@6, so the global AI_SDK_LOG_WARNINGS spec-compatibility
warning no longer fires. The suppression was dead code (and its comment
stale/misleading); verified no AI SDK warning surfaces via providerFactory
tests + full build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jithin23-kv and others added 2 commits July 23, 2026 13:56
The @ai-sdk/* providers, ai, yaml and zod are already runtime dependencies
of @keyvaluesystems/agent-opfor-core, which the cli bundle inlines via
esbuild. Re-declaring them in the cli forced version bumps in two places
(as this PR did). Removed the 9 duplicates; kept the direct imports,
build tooling, and core's optional anthropic peer deps. Verified with a
clean build, typecheck and opfor smoke run.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jithin23-kv
jithin23-kv merged commit 1ef315c into master Jul 23, 2026
8 checks passed
@jithin23-kv
jithin23-kv deleted the fix/ai-sdk-mcp-sdk-audit branch July 23, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants