mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 01:51:20 -07:00
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