Skip to content

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Nov 27, 2025

Description

Use @google/genai sdk instead of fetching responses from the url. This correctly parses the response chunks without checking for json delimiterss

resolves CON-4266
closes #2651

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

before.mp4
after.mp4

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Summary by cubic

Switch Gemini and Vertex streaming to the @google/genai SDK for reliable chunk parsing and consistent streaming. Addresses Linear CON-4266 and fixes issues with JSON delimiter-based parsing.

  • Refactors

    • Gemini adapter uses GoogleGenAI.generateContentStream and proper stream processing for text, tool calls, thought signatures, and usage.
    • VertexAI adapter initializes GoogleGenAI (API key or Vertex project/region) and streams Gemini via the SDK; Anthropic/Mistral paths unchanged.
    • Core llms (Gemini, Vertex) route chat, embed, list, rerank, and streaming through the OpenAI adapter via useOpenAIAdapterFor.
  • Dependencies

    • Added @google/genai ^1.30.0.

Written for commit 77d63db. Summary will update automatically on new commits.

@uinstinct uinstinct requested a review from a team as a code owner November 27, 2025 09:49
@uinstinct uinstinct requested review from Patrick-Erichsen and removed request for a team November 27, 2025 09:49
@continue
Copy link
Contributor

continue bot commented Nov 27, 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

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 27, 2025
@continue
Copy link
Contributor

continue bot commented Nov 27, 2025

✅ Jira ticket created with business summary

🎫 View ticket: https://continue-playground.atlassian.net/browse/CRM-14

This ticket captures the business impact and user benefits of fixing the Gemini/Vertex streaming character loss issue.

@continue
Copy link
Contributor

continue bot commented Nov 27, 2025

Fixed an incorrect documentation change in packages/openai-adapters/README.md.

The PR had incorrectly marked Bedrock and VertexAI adapters as unsupported (unchecked), but these adapters remain fully functional after the SDK migration. Restored the checkmarks to indicate continued support.

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 6 files

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Gemini output swallows square bracket

1 participant