Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/a2a-server/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
DEFAULT_GEMINI_MODEL,
type ExtensionLoader,
startupProfiler,
PREVIEW_GEMINI_MODEL,
} from '@google/gemini-cli-core';

import { logger } from '../utils/logger.js';
Expand All @@ -38,7 +39,9 @@ export async function loadConfig(

const configParams: ConfigParameters = {
sessionId: taskId,
model: DEFAULT_GEMINI_MODEL,
model: settings.general?.previewFeatures
? PREVIEW_GEMINI_MODEL
: DEFAULT_GEMINI_MODEL,
Comment on lines +42 to +44
Copy link
Contributor

Choose a reason for hiding this comment

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

high

There's a potential issue with how the model is selected. The model is determined here based on the settings.general?.previewFeatures value. However, for users authenticating with Google (USE_CCPA), the previewFeatures flag can be enabled later via experiments inside the config.refreshAuth() call.

When this happens, config.previewFeatures will become true, but the model will remain DEFAULT_GEMINI_MODEL because this logic is not re-evaluated. This can lead to an inconsistent state where preview features are enabled but the required preview model is not being used.

To resolve this, I recommend setting the model after refreshAuth has been called to ensure you are using the final value of previewFeatures. You can set the default model here, and then conditionally update it to PREVIEW_GEMINI_MODEL after the authentication block later in this function.

    model: DEFAULT_GEMINI_MODEL,

embeddingModel: DEFAULT_GEMINI_EMBEDDING_MODEL,
sandbox: undefined, // Sandbox might not be relevant for a server-side agent
targetDir: workspaceDir, // Or a specific directory the agent operates on
Expand Down