Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Jan 29, 2026

Summary

Migrate the Cerebras provider from manual fetch-based implementation (362 lines) to use OpenAICompatibleHandler with Vercel AI SDK (~70 lines).

Changes

  • Rewrote src/api/providers/cerebras.ts using AI SDK pattern
  • Updated tests to match AI SDK streaming behavior (tool-call events now ignored)
  • Preserved X-Cerebras-3rd-Party-Integration: roocode attribution header

Removed (AI SDK handles automatically)

  • Manual fetch and SSE parsing
  • TagMatcher for <think> tags (AI SDK emits reasoning-delta)
  • Tool schema stripping (minItems/maxItems)
  • Manual token estimation

Testing

  • All 17 Cerebras tests pass
  • Full test suite passes (5316 tests)

Fixes EXT-690


Important

Migrates Cerebras provider to AI SDK, simplifying implementation and updating tests for new streaming behavior.

  • Behavior:
    • Migrates CerebrasHandler in cerebras.ts to use OpenAICompatibleHandler with Vercel AI SDK.
    • Preserves X-Cerebras-3rd-Party-Integration: roocode header.
    • Updates tests in cerebras.spec.ts to match AI SDK streaming behavior, ignoring tool-call events.
  • Removed:
    • Manual fetch and SSE parsing.
    • TagMatcher for <think> tags.
    • Tool schema stripping (minItems/maxItems).
    • Manual token estimation.
  • Testing:
    • All 17 Cerebras tests pass.
    • Full test suite passes (5316 tests).
  • Dependencies:
    • Adds @ai-sdk/cerebras to package.json.

This description was created by Ellipsis for c9ea6ba. You can customize this summary. It will automatically update as commits are pushed.

@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners January 29, 2026 21:08
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. Enhancement New feature or request labels Jan 29, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 29, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. All previous issues have been addressed.

  • Move @ai-sdk/cerebras from devDependencies to dependencies in src/package.json (it's used in production code)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@daniel-lxs daniel-lxs force-pushed the feature/ext-690-migrate-cerebras-provider-to-ai-sdk branch from 1976734 to a212574 Compare January 29, 2026 21:20
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jan 29, 2026
- Rewrote cerebras.ts from 362 lines to ~170 lines using @ai-sdk/cerebras
- Uses createCerebras from the dedicated Cerebras AI SDK package
- Uses streamText/generateText from 'ai' package
- Preserved X-Cerebras-3rd-Party-Integration: roocode attribution header
- Updated tests to mock @ai-sdk/cerebras
- Removed manual fetch/SSE parsing, TagMatcher, tool schema stripping
@daniel-lxs daniel-lxs force-pushed the feature/ext-690-migrate-cerebras-provider-to-ai-sdk branch from a212574 to c9ea6ba Compare January 29, 2026 21:28
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 29, 2026
@daniel-lxs daniel-lxs merged commit 0f43cc9 into main Jan 29, 2026
13 checks passed
@daniel-lxs daniel-lxs deleted the feature/ext-690-migrate-cerebras-provider-to-ai-sdk branch January 29, 2026 22:08
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 29, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants