Skip to content
Closed
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions docs/get-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,19 @@ their corresponding top-level category object in your `settings.json` file.
}
}
},
"flash-lite-helper": {
"extends": "base",
"modelConfig": {
"model": "gemini-2.5-flash-lite",
"generateContentConfig": {
"temperature": 0.2,
"maxOutputTokens": 120,
"thinkingConfig": {
"thinkingBudget": 0
}
}
}
},
"edit-corrector": {
"extends": "base",
"modelConfig": {
Expand Down
80 changes: 80 additions & 0 deletions packages/cli/src/integration-tests/modelSteering.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { describe, it, afterEach } from 'vitest';
import { AppRig } from '../test-utils/AppRig.js';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { PolicyDecision } from '@google/gemini-cli-core';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

describe('Model Steering Integration', () => {
let rig: AppRig | undefined;

afterEach(async () => {
await rig?.unmount();
});

it('should steer the model using a hint during a tool turn', async () => {
const fakeResponsesPath = path.join(
__dirname,
'../test-utils/fixtures/steering.responses',
);
rig = new AppRig({ fakeResponsesPath });
await rig.initialize();
await rig.waitForIdle();

rig.setToolPolicy('list_directory', PolicyDecision.ASK_USER);
rig.setToolPolicy('read_file', PolicyDecision.ASK_USER);

rig.setMockCommands([
{
command: /list_directory/,
result: {
output: 'file1.txt\nfile2.js\nfile3.md',
exitCode: 0,
},
},
{
command: /read_file file1.txt/,
result: {
output: 'This is file1.txt content.',
exitCode: 0,
},
},
]);

// Start a long task
await rig.type('Start long task');
await rig.pressEnter();

// Wait for the model to call 'list_directory' (Confirming state)
await rig.waitForOutput('ReadFolder');

// Injected a hint while the model is in a tool turn
rig.addUserHint('focus on .txt');

// Resolve list_directory (Proceed)
await rig.resolveTool('ReadFolder');

// Wait for the model to process the hint and output the next action
// Based on steering.responses, it should first acknowledge the hint
await rig.waitForOutput('ACK: I will focus on .txt files now.');

// Then it should proceed with the next action
await rig.waitForOutput(
/Since you want me to focus on .txt files,[\s\S]*I will read file1.txt/,
);
await rig.waitForOutput('ReadFile');

// Resolve read_file (Proceed)
await rig.resolveTool('ReadFile');

// Wait for final completion
await rig.waitForOutput('Task complete.');
});
});
40 changes: 40 additions & 0 deletions packages/cli/src/test-utils/AppRig.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

import { describe, it, afterEach } from 'vitest';
import { AppRig } from './AppRig.js';
import path from 'node:path';
import { fileURLToPath } from 'node:url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

describe('AppRig', () => {
let rig: AppRig | undefined;

afterEach(async () => {
await rig?.unmount();
});

it('should render the app and handle a simple message', async () => {
const fakeResponsesPath = path.join(
__dirname,
'fixtures',
'simple.responses',
);
rig = new AppRig({ fakeResponsesPath });
await rig.initialize();

// Wait for initial render
await rig.waitForOutput('Type your message');

// Type a message
await rig.type('Hello');
await rig.pressEnter();

// Wait for model response
await rig.waitForOutput('Hello! How can I help you today?');
});
});
Loading