-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Labels
Description
Problem
Gemini CLI supports gemini --resume "latest" for resuming the most recent session, and stores session JSON files under ~/.gemini/tmp/<project_hash>/chats/. The module's start.sh always starts a fresh session with no resume logic. It also doesn't pass --type gemini to agentapi.
The module currently passes the task prompt via --prompt-interactive "$PROMPT". On resume, this must be skipped.
Desired outcome
- On cold start: Gemini starts normally with the task prompt.
- On warm start (prior sessions exist): Gemini resumes the latest session. The task prompt is not re-sent.
--type geminiis passed toagentapi server.- Expose
enable_state_persistenceinmain.tf(defaulttrue) and pass it through to themodule "agentapi"block so the Coder UI preserves chat history across restarts, matching the agent's resumed session.
Key upstream behaviors
- Critical:
--resume "latest"causes a dead loop when no sessions exist (google-gemini/gemini-cli#15892). The module MUST check for existing sessions before passing--resume. Session files live under~/.gemini/tmp/*/chats/*.json. - Session files can grow very large (400MB+ reported in google-gemini/gemini-cli#15292) for long-running tasks.
Version bump
minor
Refs #696, coder/internal#1258
Reactions are currently unavailable