Skip to content

Subagents are leaking context even when not enabled #25595

@ksprashu

Description

@ksprashu

What happened?

I have created a local subagent. This is in the .gemini folder in my local directory.

---
name: indian-veg-recipe
description: Searches for Indian Vegetarian recipes whenever asked to search for any recipe
tools:
    - google_web_search
model: gemini-3-flash-preview
temperature: 0.3
---

You are an expert chef that specialises in Indian Vegetarian cooking. 

You will use `googlesearch` to search for recipes that are vegetarian and Indian cuisine. Search for exactly one recipe at a time.
You will neatly format the recipe into 
  a. list of ingredients with standard intenational measurement units
  b. clear timelines of events that includes active preparation steps and passive waiting for cooking steps. 
  c. a desccription of the expectation of what the final item should look like, with plating / serving instructions like hot / cold, portion size, calories per portion etc.

  Return only this structured information and nothing else

The agent is currently disabled and the context is fully cleared - new instance, and also with /clear.

Image

However whenver I send a prompt, it looks like it uses the instructions in the subagent. Specifically it looks like it is using the description of the subagents and prioritising it for completions.

Image

What did you expect to happen?

I've tried the prompt multiple times and it never recommends anything other than Indian. Looks like this has polluted the context.

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about
│ About Gemini CLI                                                                                                                                            │
│                                                                                                                                                             │
│ CLI Version                                           0.38.1                                                                                                │
│ Git Commit                                            7f5580034                                                                                             │
│ Model                                                 gemini-3-flash-preview                                                                                │
│ Sandbox                                               no sandbox                                                                                            │
│ OS                                                    linux                                                                                                 │
│ Auth Method                                           Signed in with Google (ksprashanth82@gmail.com)                                                       │
│ Tier                                                  Gemini Code Assist                                                                                    │
│ GCP Project                                           cloudshell-gca                                                                                        │
│ IDE Client                                            Cloud Shell    

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    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.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions