Conversation
The Gemini v1internal (cloudcode-pa) and Antigravity Manager endpoints require camelCase "systemInstruction" in request JSON. The current snake_case "system_instruction" causes system prompts to be silently ignored when routing through these endpoints. Replace all "system_instruction" JSON keys with "systemInstruction" in chat-completions and responses request translators.
- Update README.md with All API Hub entry in English - Update README_CN.md with All API Hub entry in Chinese
…gistration When new OAuth auth files are added while the service is running, `applyCoreAuthAddOrUpdate` calls `coreManager.Register()` (which upserts into the scheduler) BEFORE `registerModelsForAuth()`. At upsert time, `buildScheduledAuthMeta` snapshots `supportedModelSetForAuth` from the global model registry — but models haven't been registered yet, so the set is empty. With an empty `supportedModelSet`, `supportsModel()` always returns false and the new auth is never added to any model shard. Additionally, when all existing accounts are in cooldown, the scheduler returns `modelCooldownError`, but `shouldRetrySchedulerPick` only handles `*Error` types — so the `syncScheduler` safety-net rebuild never triggers and the new accounts remain invisible. Fix: 1. Add `RefreshSchedulerEntry()` to re-upsert a single auth after its models are registered, rebuilding `supportedModelSet` from the now-populated registry. 2. Call it from `applyCoreAuthAddOrUpdate` after `registerModelsForAuth`. 3. Make `shouldRetrySchedulerPick` also match `*modelCooldownError` so the full scheduler rebuild triggers when all credentials are cooling down — catching any similar stale-snapshot edge cases.
fix: use camelCase systemInstruction in OpenAI-to-Gemini translators
docs: add All API Hub to related projects list
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the authentication manager's scheduling mechanism by ensuring that supported models for authentication entries are accurately and promptly reflected. It introduces a dedicated function to refresh an authentication's model set in the scheduler, preventing issues where newly added or updated configurations might be overlooked. Additionally, it enhances the scheduler's resilience by improving how it handles model cooldown errors and updates project documentation. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a critical fix for the authentication scheduler, ensuring newly added or updated credentials are immediately available for routing by explicitly refreshing the scheduler entry after models are registered for an auth. While addressing these functional improvements, two security issues were identified: a potential rate limit bypass and session hijacking vulnerability in the websocket connection handling, and an LLM safety issue where system instructions are downgraded to user-level authority during translation. The changes also include a new RefreshSchedulerEntry method in the auth.Manager, comprehensive tests, an adjustment to the retry mechanism for graceful error handling, and minor updates to documentation and the Gemini translator for consistency.
| m.mu.RLock() | ||
| auth, ok := m.auths[authID] | ||
| if !ok || auth == nil { | ||
| m.mu.RUnlock() | ||
| return | ||
| } | ||
| snapshot := auth.Clone() | ||
| m.mu.RUnlock() | ||
| m.scheduler.upsertAuth(snapshot) |
There was a problem hiding this comment.
For improved readability and to avoid multiple RUnlock calls, you can restructure this section. The goal is to fetch and clone the auth within a single locked block, then perform the scheduler update outside the lock. This makes the lock's scope clearer and the code flow more linear, improving maintainability.
var snapshot *Auth
m.mu.RLock()
if auth, ok := m.auths[authID]; ok && auth != nil {
snapshot = auth.Clone()
}
m.mu.RUnlock()
if snapshot == nil {
return
}
m.scheduler.upsertAuth(snapshot)
No description provided.