Add /background commands (when background agent is configured) (#4407)

Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
This commit is contained in:
Tommaso Sciortino
2025-07-18 15:38:04 -07:00
committed by GitHub
parent 04bbc60b97
commit 003609239f
12 changed files with 563 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import { render } from 'ink-testing-library';
import { AppWrapper as App } from './App.js';
import {
Config as ServerConfig,
BackgroundAgentManager,
MCPServerConfig,
ApprovalMode,
ToolRegistry,
@@ -51,6 +52,7 @@ interface MockServerConfig {
getSandbox: Mock<() => SandboxConfig | undefined>;
getTargetDir: Mock<() => string>;
getToolRegistry: Mock<() => ToolRegistry>; // Use imported ToolRegistry type
getBackgroundAgentManager: Mock<() => BackgroundAgentManager>;
getDebugMode: Mock<() => boolean>;
getQuestion: Mock<() => string | undefined>;
getFullContext: Mock<() => boolean>;
@@ -117,6 +119,7 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => {
getSandbox: vi.fn(() => opts.sandbox),
getTargetDir: vi.fn(() => opts.targetDir || '/test/dir'),
getToolRegistry: vi.fn(() => ({}) as ToolRegistry), // Simple mock
getBackgroundAgentManager: vi.fn(() => new BackgroundAgentManager([])),
getDebugMode: vi.fn(() => opts.debugMode || false),
getQuestion: vi.fn(() => opts.question),
getFullContext: vi.fn(() => opts.fullContext ?? false),