← All guides AI Release
RU Subscribe to @ai_releaseorg

How to Fix the "Your conversation got too long" Error in Google Antigravity: Context Compaction, Limits and Switching to Gemini

Updated: 23.11.2026 · AI Release · @ai_releaseorg
How to Fix the "Your conversation got too long" Error in Google Antigravity: Context Compaction, Limits and Switching to Gemini

TL;DR

What you will get

Quick start

cd <your-project>
git switch -c chore/handoff-$(date +%Y%m%d)
git status --short
git diff --stat
printf '# Handoff\n\n## Goal\n\n## Done\n\n## Next\n\n## Files\n' > HANDOFF.md
git add HANDOFF.md && git commit -m "chore: context handoff"

Details and verification are in the steps below.

Prompt for copying

PromptCopy the whole block — this is the ready-to-use system prompt
You are compacting an interrupted working session so a fresh conversation can continue it.

Do not write or modify application code in this turn. Produce one file named HANDOFF.md in the repository root and nothing else.

Use exactly these sections, in this order:

# Handoff
## Goal
One paragraph: what the user is trying to ship, in their own terms.
## Done
A bullet list of changes already applied. For each item give the file path and one line on what changed. Do not paste file contents.
## Decisions
A bullet list of choices made and the reason for each, including rejected options.
## Open questions
Anything unresolved, ambiguous, or blocked, with the exact question that needs an answer.
## Next
A numbered list of the next three actions, each small enough to finish in one turn. Each action names the file or command involved.
## Files
A bullet list of files the next session must read first, in priority order. Mark the one file where the work resumes with the word START.
## Reproduce
The exact shell commands needed to rebuild the current state from a clean checkout, in order, one command per line.

Rules:
- Never invent a file path, command, version number or test result. If you do not know a value, write "check the docs" next to it.
- Do not paste logs or tool output longer than five lines. Give the command that regenerates the output instead.
- Keep the whole file under 100 lines.
- Write in the language the user has been using in this conversation.

After writing the file, reply with the single line: HANDOFF READY.

Replace before use: <your-project> — the folder where the repository lives; <task-name> — a short slug for the task, used in branch names.

Requirements and setup

Illustration: Requirements and setup
Illustration: Requirements and setup

Step 1. Freeze the state of the interrupted session

What to do: Before touching the model or the conversation, record what the agent already produced. Run these three commands inside the project folder:

cd <your-project>
git status --short
git diff --stat
git log --oneline -5

Then copy the agent's last useful message out of the conversation into a scratch note — the plan it proposed, or the list of files it said it would touch.

Why: A conversation that reports it is too long is a conversation whose working state lives only in that window. If you close it first, you will re-attach the same files to a new chat and hit the same wall within a few turns. Capturing the diff first turns "restart" into "continue".

How to check: git status --short prints either nothing or a short list of paths, and git diff --stat prints one line per touched file with an added/removed count, for example:

 src/api/client.ts   | 42 ++++++++++++++++----
 src/api/routes.ts   | 18 +++++----
 2 files changed, 47 insertions(+), 13 deletions(-)

If git status --short lists files you did not expect, commit or stash them now with git stash push -m "pre-handoff" — otherwise the next conversation cannot tell your edits from the agent's.

Step 2. Write `HANDOFF.md` and cut the context weight

Illustration: Step 2. Write HANDOFF.md and cut the context weight
Illustration: Step 2. Write HANDOFF.md and cut the context weight

What to do: Create the handoff file and, at the same time, remove from the working set everything the next session does not need.

1. Ask the current conversation to produce the file using the prompt in “Prompt for copying” above. If the conversation already refuses to answer because of the length error, write the file by hand using the same section list — it takes about five minutes.

2. Edit it down: keep one paragraph under ## Goal, and no more than three numbered actions under ## Next.

3. Close every editor tab and unpin every file that is not in the ## Files list.

4. Remove from the conversation's working set any folder the task does not touch — build output, node_modules, datasets, generated assets. Antigravity is a workspace-scoped agent, so files inside the open workspace can be read and pulled into context even when you did not attach them explicitly.

5. Commit the file so the next session can open it with a single command.

git add HANDOFF.md
git commit -m "chore: context handoff"
wc -l HANDOFF.md

Why: The length limit is measured against everything the agent has accumulated — your messages, its replies, the file contents it read, and the output of the commands it ran. Tool output is the usual culprit: one npm test run or one large cat can spend more of the window than a hundred chat turns. A handoff file replaces all of that with a few hundred words the agent can act on.

How to check: wc -l HANDOFF.md prints a number below 100, for example:

48 HANDOFF.md

Then open HANDOFF.md and confirm that a colleague who has never seen the task could start from the ## Next list. If a step there reads “fix the bug”, it is too vague — rewrite it as “change the timeout in src/api/client.ts to read from API_TIMEOUT_MS”.

Before you open the new chat, walk this checklist:

Step 3. Open a new conversation on Gemini and verify

Illustration: Step 3. Open a new conversation on Gemini and verify
Illustration: Step 3. Open a new conversation on Gemini and verify

What to do: Start a new conversation, select Gemini in the model picker of the agent panel, and seed it with the handoff file only.

Read HANDOFF.md. Do not read any other file yet.
Reply with: the goal in one line, the START file path, and the first action from ## Next.

Why: A new conversation starts with an empty window, so the length budget is spent only on what you give it. Selecting Gemini matters because the model picker changes which backend answers, and different models in the picker carry different limits — the exact limit for each model is not fixed in the UI and must be checked against the current documentation. What you are doing here is not “a bigger model”, it is a clean window plus a smaller payload.

How to check: The agent's reply names the goal, the START path and one action, and nothing else — if it starts summarising the whole repository, the handoff prompts it to explore too much; tighten ## Next. Then confirm the selected model on screen: the model name is displayed next to the input box, and it must read Gemini, not the model that produced the original error. Send one real task from ## Next and confirm the answer streams normally with no length warning.

Use this table to pick the right fix instead of guessing:

ActionFixesDoes not fix
Same conversation, shorter messagenothing — the accumulated window is already spentthe length error
New conversation, no handoffa stuck windowyou re-attach the same files and hit the limit again
New conversation + `HANDOFF.md` + Geminia stuck window with the task preservedvery large single-file reads, which still fill the window
Switching models inside the old conversationresponse qualitythe length error, which is per conversation

Troubleshooting

Problem. The error appears after only three or four messages.

Problem. The new conversation still shows the length warning on the first message.

Problem. After the switch, the agent "forgets" the plan and re-proposes work that is already done.

Summary and next steps

You now have a committed HANDOFF.md and a clean Gemini conversation that continues the same task. Keep the handoff file updated at the end of each long session, and when you need to choose between assistants before committing to one, use the AI assistant comparison.

FAQ

Does starting a new conversation delete my code or my files?

No. A conversation is chat history plus context; the files on disk are untouched. That is exactly why Step 1 commits or stashes first — the only real loss is uncommitted work.

Why does the error appear when my chat looks short?

Because the limit counts everything the agent has read and every command output it has received, not just the visible messages. A single large file read or a verbose test run can consume the window in one turn.

Does switching to Gemini keep my previous conversation?

No. The model picker changes which model answers; the previous conversation keeps its own accumulated history. Switching inside an old conversation does not free the window — you need a new conversation seeded with HANDOFF.md.

Can I raise the context limit instead of compacting?

Not from the app settings. The limit is set per model by the provider, and available models change between releases — check the documentation for the current list and limits before planning a long session around one model.

🤖 AI summary

AI Release Knowledge Layer
Machine-readable description · Version 1.0

Status: practical guide. Some statements come from vendors; verify in your environment.

1. Summary

Time to complete: 15 minutes You will need: Google Antigravity installed and signed in, a Git repository for the project the agent is working on, a terminal with Git 2.x, and the conversation that currently shows the length error.

Inside: direct answers, key facts, entities, context, reliability, unknowns and sources.

Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.

Full Knowledge Layer: sections 2–8

2. Direct answers

What is required?
A desktop build of Google Antigravity, installed and signed in with your Google account. Supported operating systems and the exact download — check the official download page for your platform.; The project folder the agent was editing, already a Git repository. If it is not, run git init inside it before Step 1.; Git… → details (AR-GUIDE-KAKISPRAVI-003)
How to do it?
Step 1. Freeze the state of the interrupted session → Step 2. Write `HANDOFF.md` and cut the context weight → Step 3. Open a new conversation on Gemini and verify → details (AR-GUIDE-KAKISPRAVI-004)
Which topics does it cover?
разговор стал слишком длинным antigravity, google antigravity лимит контекста, как увеличить контекст ии-агента, antigravity сжатие истории диалога → details (AR-GUIDE-KAKISPRAVI-002)
What are the key points?
Time to complete: 15 minutes You will need: Google Antigravity installed and signed in, a Git repository for the project the agent is working on, a terminal with Git 2.x, and the conversation that currently shows the length error. → details (AR-GUIDE-KAKISPRAVI-007)

3. Key facts

  1. Time to complete: 15 minutes — evidence; status: заявление источника.
  2. You will need: Google Antigravity installed and signed in, a Git repository for the project the agent is working on, a terminal with Git 2.x, and the conversation that currently shows the length error. — evidence; status: заявление источника.
  3. A desktop build of Google Antigravity, installed and signed in with your Google account. Supported operating systems and the exact download — check the official download page for your platform. — evidence; status: заявление источника.
  4. The project folder the agent was editing, already a Git repository. If it is not, run git init inside it before Step 1. — evidence; status: заявление источника.
  5. Git 2.x and a shell: git --version must print a version. — evidence; status: заявление источника.

4. Entities

EntityTypeRole
разговор стал слишком длинным antigravityтема/инструментупоминается в заголовке, TL;DR или разделах гайда
google antigravity лимит контекстатема/инструментупоминается в заголовке, TL;DR или разделах гайда
как увеличить контекст ии-агентатема/инструментупоминается в заголовке, TL;DR или разделах гайда
antigravity сжатие истории диалогатема/инструментупоминается в заголовке, TL;DR или разделах гайда
Gitплатформа/технологияупоминается в заголовке, TL;DR или разделах гайда
Googleкомпанияупоминается в заголовке, TL;DR или разделах гайда
Geminiтема/инструментупоминается в заголовке, TL;DR или разделах гайда

5. Context

  • Guide — describes → How to Fix the "Your conversation got too long" Error in Google Antigravity: Context Compaction, Limits and Switching to Gemini (AR-GUIDE-KAKISPRAVI-001).
  • Guide — includes step → Step 1. Freeze the state of the interrupted session (AR-GUIDE-KAKISPRAVI-001).

6. Reliability

Confirmed

No independent confirmation is provided; source claims and editorial conclusions are separated below.

Source claims

  • Product features, versions, prices and limits come from vendors and the guide.
  • Commands and steps are recommendations, not guaranteed results.

AI Release analysis

  • Structure, comparison and selection criteria are editorial.
  • The guide does not replace an independent audit or legal advice.

7. Unknowns

  • Current versions, prices and limits.
  • Independent benchmarks and quality checks.
  • Terms of use and data policy.

8. Sources

SourceTypeRole
No external links——

Cite as: AI Release. Как исправить ошибку «Ваш разговор стал слишком длинным» в Google Antigravity: сжатие контекста, лимиты и переход на Gemini. ai-release.org.