mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 19:14:33 -07:00
feat: add Forever Mode for autonomous long-running agent sessions
Add --forever CLI flag that enables autonomous agent operation with auto-resume, context management, and session optimization. Core features: - schedule_work tool: agent declares pause duration, system auto-resumes with countdown timer - PreCompress hook enhancement: hooks can return newHistory to replace built-in LLM compression - Idle hook: fires after configurable inactivity, can auto-submit prompts - Forever mode disables MemoryTool, EnterPlanModeTool, interactive shell Session optimization for long-running sessions: - Record lastCompressionIndex on ConversationRecord; on resume, only load post-compression messages (O(N) → O(recent)) - Skip file I/O in updateMessagesFromHistory when no tool results to sync - Prune UI history to last 50 items after each context compression to prevent unbounded memory growth
This commit is contained in:
@@ -85,6 +85,7 @@ describe('useQuotaAndFallback', () => {
|
||||
updateItem: vi.fn(),
|
||||
clearItems: vi.fn(),
|
||||
loadHistory: vi.fn(),
|
||||
pruneItems: vi.fn(),
|
||||
};
|
||||
mockSetModelSwitchedFromQuotaError = vi.fn();
|
||||
mockOnShowAuthSelection = vi.fn();
|
||||
|
||||
Reference in New Issue
Block a user