Skip to content

/clear command fails to update plan/task directories for the new session #25500

@ruomengz

Description

@ruomengz

Summary:
Executing the /clear command in Gemini CLI resets the conversation and generates a new session ID. While the Config object is updated with this new ID, the internal Storage instance remains tied to the initial session ID because it is set at construction and cannot be modified. As a result, the agent's system prompt and planning/tracking tools continue to use the file paths from the previous session, leading to "Plan Mode" pointing to the wrong directory.

Steps to Reproduce:

  1. Start a session and enter Plan Mode.
  2. Create a plan and approve.
  3. Run /clear.
  4. Enter plan mode.
  5. Observed Behavior: It is showing approved plan from step 2.
  6. Expected Behavior: It is a new session, there should be no approved plan.

Metadata

Metadata

Labels

area/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitystatus/need-triageIssues that need to be triaged by the triage automation.workstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreams

Type

No fields configured for Task.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions