Description of the Problem: When having extended conversations with the agent, the internal context naturally grows. Currently, there is no way for users to predict when they will hit the model’s maximum context window capacity. Once the context window is full, the agent abruptly crashes with a 400 error:
agent executor error: INVALID_ARGUMENT (code 400): invalid_request_error: prompt is too long: 203669 tokens > 200000 maximum
The real issue lies in the hidden base context—the conversation history, workspace state, and system prompts that Antigravity IDE automatically accumulates behind the scenes. When this base context silently fills up the context window, the agent breaks unpredictably, forcing users into a frustrating guessing game of when to start a new chat.
Proposed Solutions: To make the agent’s behavior more predictable, I propose adding a visual indicator based strictly on the system-accumulated context.
-
1. Visual Color-Coded Alerts for Context Capacity (Core Idea): Implement a dynamic UI change based on the IDE’s internal context consumption. If the system-managed context (conversation history + IDE state) reaches 80% of the model’s capacity, the chat window’s border or background tone could subtly change to yellow. At 95%, it turns red. This gives users a clear signal to wrap up the session before their next input pushes it over the edge.
-
2. Context Window Counter: Add a subtle UI element (e.g.,
Context Window: 85% Full) at the top or bottom of the interface. Displaying the background context weight helps power users understand how much “memory” the IDE is currently holding. -
3. “Summarize & Start New” Prompt: When the base context hits the 90% threshold, the UI could suggest: “The agent’s memory is almost full. Would you like to summarize the current context and start a new chat with the summary?”
Why this matters: By tracking the system-generated context rather than just the user’s explicit input, this feature will accurately reflect the agent’s true “memory capacity.” It replaces unpredictable crashes with manageable, predictable workflows, significantly improving the developer experience.
Thank you for considering this request!