mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
feat(browser): add maxActionsPerTask for browser agent setting (#23216)
This commit is contained in:
@@ -1474,6 +1474,22 @@ describe('Server Config (config.ts)', () => {
|
||||
expect(browserConfig.customConfig.visualModel).toBe(
|
||||
'custom-visual-model',
|
||||
);
|
||||
expect(browserConfig.customConfig.maxActionsPerTask).toBe(100); // default
|
||||
});
|
||||
|
||||
it('should return custom maxActionsPerTask', () => {
|
||||
const params: ConfigParameters = {
|
||||
...baseParams,
|
||||
agents: {
|
||||
browser: {
|
||||
maxActionsPerTask: 50,
|
||||
},
|
||||
},
|
||||
};
|
||||
const config = new Config(params);
|
||||
const browserConfig = config.getBrowserAgentConfig();
|
||||
|
||||
expect(browserConfig.customConfig.maxActionsPerTask).toBe(50);
|
||||
});
|
||||
|
||||
it('should apply defaults for partial custom config', () => {
|
||||
|
||||
@@ -331,6 +331,8 @@ export interface BrowserAgentCustomConfig {
|
||||
allowedDomains?: string[];
|
||||
/** Disable user input on the browser window during automation. Default: true in non-headless mode */
|
||||
disableUserInput?: boolean;
|
||||
/** Maximum number of actions (tool calls) allowed per task. Default: 100 */
|
||||
maxActionsPerTask?: number;
|
||||
/** Whether to confirm sensitive actions (e.g., fill_form, evaluate_script). */
|
||||
confirmSensitiveActions?: boolean;
|
||||
/** Whether to block file uploads. */
|
||||
@@ -3194,6 +3196,7 @@ export class Config implements McpContext, AgentLoopContext {
|
||||
visualModel: customConfig.visualModel,
|
||||
allowedDomains: customConfig.allowedDomains,
|
||||
disableUserInput: customConfig.disableUserInput,
|
||||
maxActionsPerTask: customConfig.maxActionsPerTask ?? 100,
|
||||
confirmSensitiveActions: customConfig.confirmSensitiveActions,
|
||||
blockFileUploads: customConfig.blockFileUploads,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user