mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-11 06:31:01 -07:00
The Plan Mode security policy expects a consistent two-level subdirectory structure after tmp/ (~/.gemini/tmp/<project>/<session-id>/plans/). Previously, Storage allowed sessionId to be optional, which resulted in a one-level structure (~/.gemini/tmp/<project>/plans/) when missing, causing the Policy Engine to deny write operations. This change enforces sessionId in the Storage constructor (defaulting to the process-wide sessionId) and ensures the Storage instance is updated when a session is resumed via Config.setSessionId(). This guarantees that generated paths always match the policy's regular expression, even across session restarts. Fixes https://github.com/google-gemini/gemini-cli/issues/21359