You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compaction happens, it resets the model to the build agent. This problem is aggravated because the switching of the agent might grant it access to extra tools or have missing tools that it was supposed to have to perform the task.
For example, I have a browse agent that has access to the browser. The build tool does not. Halfway while browsing, after compaction, the tool reverts to the build tool and starts using webfetch instead, giving nonsense results in the research.
OpenCode version
1.0.80
Steps to reproduce
Create a browse agent
Use it to access the browser
When compaction happens, the build agent is used
The continued task is now executed using the build agent
This might be a duplicate of #3099 but I'm not sure if it is exactly the same. That one is about the AGENTS.md, this one is that wrong agent itself is being used after compaction.
Something similar happens. /compact command creates next steps from the chat history and build agent gets triggered to do them. Expected behavior should be to disable any action after compact report is given. there's:
`
User
`
Which shouldn't exist there, clearly it thinks user made an action, but there was none.
Chat:
`
Assistant
Summary of Conversation
What Was Done
Tamagui Setup for Expo: Installed Tamagui packages (tamagui, @tamagui/config, @tamagui/babel-plugin, etc.) and configured the app for Expo. This included creating babel.config.js for Babel plugin integration, tamagui.config.ts with default Tamagui configuration, and tamagui-web.css for web styles. Updated tsconfig.json to include Tamagui types and wrapped the root layout (app/_layout.tsx) with TamaguiProvider.
Component Refactoring: Updated components/themed-text.tsx and components/themed-view.tsx to use Tamagui's Text and View components instead of React Native's, leveraging Tamagui's theming for consistency.
App Screen Updates: Refactored app/(tabs)/index.tsx to use Tamagui components like YStack, Card, and Button, replacing old styled views. Simplified the home screen to a clean "Welcome to the Starter Kit" layout with a centered button, removing the parallax scroll, React logo, and edit instructions. Updated app/modal.tsx to use Tamagui's View instead of React Native's.
Navigation Changes: Modified app/(tabs)/_layout.tsx to hide the bottom tab bar (tabBarStyle: { display: 'none' }) for a web-app-like layout. Removed the explore tab and deleted app/(tabs)/explore.tsx.
Git Management: Staged all changes, unstaged the generated .tamagui/tamagui.config.json file, added .tamagui/ to .gitignore to exclude generated configs, and committed the relevant files.
What Is Currently Being Worked On
The Expo app is fully set up with Tamagui as the UI framework, with navigation hidden and a minimal starter kit home screen. No active modifications in progress; the app is in a ready state for further development.
Modified: package.json (added dependencies), tsconfig.json (added types), app/_layout.tsx (added TamaguiProvider), app/(tabs)/_layout.tsx (hid tabs), app/(tabs)/index.tsx (refactored to Tamagui layout), app/modal.tsx (updated to Tamagui View), components/themed-text.tsx and components/themed-view.tsx (refactored to Tamagui components), .gitignore (added .tamagui/).
Deleted: app/(tabs)/explore.tsx.
Unstaged/Ignored: .tamagui/tamagui.config.json (generated file, now ignored).
What Needs to Be Done Next
The app is now a clean Tamagui-based starter kit. Potential next steps include adding custom navigation (e.g., a sidebar or header menu), integrating more Tamagui components, implementing routing for additional screens, or building out features like forms, data fetching, or authentication. If you have a specific direction (e.g., adding a new page or feature), let me know to continue development. Run expo start to test the current setup.
I just pulled latest and can confirm that this is fixed in the simple case, but is still happening when the sub-agent accidentially overruns the context size:
When this error occurs:
litellm.ContextWindowExceededError: litellm.BadRequestError: ContextWindowExceededError: OpenAIException - This model's maximum context length is 32000 tokens. However, your request has 56121 input tokens. Please reduce the length of the input messages. (parameter=input_tokens, value=56121) None
model=glm-4.7-fp8. context_window_fallbacks=None. fallbacks=None.
Set 'context_window_fallback' - https://docs.litellm.ai/docs/routing#fallbacks. Received Model Group=glm-4.7-fp8
Available Model Group Fallbacks=None
After this error, it continues processing in the primary agent context, as reported in the bug above.
Activity
conradkoh commentedon Nov 20, 2025
This might be a duplicate of #3099 but I'm not sure if it is exactly the same. That one is about the AGENTS.md, this one is that wrong agent itself is being used after compaction.
emincangencer commentedon Nov 20, 2025
Something similar happens. /compact command creates next steps from the chat history and build agent gets triggered to do them. Expected behavior should be to disable any action after compact report is given. there's:
`
User
`
Which shouldn't exist there, clearly it thinks user made an action, but there was none.
Chat:
`
Assistant
Summary of Conversation
What Was Done
tamagui,@tamagui/config,@tamagui/babel-plugin, etc.) and configured the app for Expo. This included creatingbabel.config.jsfor Babel plugin integration,tamagui.config.tswith default Tamagui configuration, andtamagui-web.cssfor web styles. Updatedtsconfig.jsonto include Tamagui types and wrapped the root layout (app/_layout.tsx) withTamaguiProvider.components/themed-text.tsxandcomponents/themed-view.tsxto use Tamagui'sTextandViewcomponents instead of React Native's, leveraging Tamagui's theming for consistency.app/(tabs)/index.tsxto use Tamagui components likeYStack,Card, andButton, replacing old styled views. Simplified the home screen to a clean "Welcome to the Starter Kit" layout with a centered button, removing the parallax scroll, React logo, and edit instructions. Updatedapp/modal.tsxto use Tamagui'sViewinstead of React Native's.app/(tabs)/_layout.tsxto hide the bottom tab bar (tabBarStyle: { display: 'none' }) for a web-app-like layout. Removed the explore tab and deletedapp/(tabs)/explore.tsx..tamagui/tamagui.config.jsonfile, added.tamagui/to.gitignoreto exclude generated configs, and committed the relevant files.What Is Currently Being Worked On
Which Files Were Modified/Created
babel.config.js,tamagui.config.ts,tamagui-web.css.package.json(added dependencies),tsconfig.json(added types),app/_layout.tsx(added TamaguiProvider),app/(tabs)/_layout.tsx(hid tabs),app/(tabs)/index.tsx(refactored to Tamagui layout),app/modal.tsx(updated to Tamagui View),components/themed-text.tsxandcomponents/themed-view.tsx(refactored to Tamagui components),.gitignore(added.tamagui/).app/(tabs)/explore.tsx..tamagui/tamagui.config.json(generated file, now ignored).What Needs to Be Done Next
expo startto test the current setup.User
Assistant
Assistant
Assistant
Assistant
Assistant
Assistant
Assistant
Assistant
Assistant
Assistant
Assistant
`
I canceled after that.
wolfie82 commentedon Nov 20, 2025
I believe this is related to #4475 and #4431
rekram1-node commentedon Nov 21, 2025
Should be fixed in next release
jcowles commentedon Jan 12, 2026
I just pulled latest and can confirm that this is fixed in the simple case, but is still happening when the sub-agent accidentially overruns the context size:
When this error occurs:
After this error, it continues processing in the primary agent context, as reported in the bug above.