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
{{ message }}
Repository navigation
Is there any way to debug compaction/token usage/prompts? #4113
I feel like compaction is not working correctly currently.. i have 'limited' token budget (~130k) for my models and compaction runs like, every second message, even if it's just "wait a sec" and the agent returns "yeah sure" i see increases of token budgets by like 40k tokens.. then we'll spiral in auto compaction which only reduces the token usage down to like 90k.. and of course, if this wasn't strange enough, the compaction leads to pretty annoying memory loss/shift of objectives, which i can understand but it just feels off if it happens every few messages..
any hints on how to deliver more useful insights/bug reports to you guys? thanks!
In ~/.local/share/opencode/log you can find the opencode logs - by default the compaction logs don't have much info - just stuff like: INFO 2025-11-04T20:38:02 +0ms service=session.compaction pruning but per the docs - if you ran opencode with debug logging (opencode --log-level DEBUG) you might see more interesting info in there.
Other than that - can you share the opencode config you're using? (your repo level opencode.json and your global config at ~/.config/opencode/opencode.json
thanks! will give this a try. currently it looks like there haven't been any logs written for 2 days. in regards to your request, sure but it's pretty much standard, just tested the openai oauth codex plugin.. but i'm using primarily github copilot as agents
Activity
Aureatus commentedon Nov 9, 2025
In
~/.local/share/opencode/logyou can find the opencode logs - by default the compaction logs don't have much info - just stuff like:INFO 2025-11-04T20:38:02 +0ms service=session.compaction pruningbut per the docs - if you ran opencode with debug logging (opencode --log-level DEBUG) you might see more interesting info in there.Other than that - can you share the opencode config you're using? (your repo level opencode.json and your global config at
~/.config/opencode/opencode.jsonoafx commentedon Nov 9, 2025
thanks! will give this a try. currently it looks like there haven't been any logs written for 2 days. in regards to your request, sure but it's pretty much standard, just tested the openai oauth codex plugin.. but i'm using primarily github copilot as agents
and no project specific opencode.json
rekram1-node commentedon Nov 9, 2025
@oafx u can export any session to json:
opencode export > out.json(if u dont redirect then it goes to stdout)It will open a list to select a session from