GeezerVison is showing github.com — Is there any way to debug compaction/token usage/prompts? · Issue #4113 · anomalyco/opencode
Is there any way to debug compaction/token usage/prompts? #4113DescriptionQuestion
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! ActivityAureatus commented on Nov 9, 2025 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 oafx commented on 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
/* cat ~/.config/opencode/opencode.json */
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
"opencode-openai-codex-auth"
],
"provider": {
"openai": {
"options": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
],
"store": false
},
"models": {
"gpt-5-codex-low": {
"name": "GPT 5 Codex Low (OAuth)",
"options": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-codex-medium": {
"name": "GPT 5 Codex Medium (OAuth)",
"options": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-codex-high": {
"name": "GPT 5 Codex High (OAuth)",
"options": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-minimal": {
"name": "GPT 5 Minimal (OAuth)",
"options": {
"reasoningEffort": "minimal",
"reasoningSummary": "auto",
"textVerbosity": "low",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-low": {
"name": "GPT 5 Low (OAuth)",
"options": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"textVerbosity": "low",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-medium": {
"name": "GPT 5 Medium (OAuth)",
"options": {
"reasoningEffort": "medium",
"reasoningSummary": "auto",
"textVerbosity": "medium",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-high": {
"name": "GPT 5 High (OAuth)",
"options": {
"reasoningEffort": "high",
"reasoningSummary": "detailed",
"textVerbosity": "high",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-mini": {
"name": "GPT 5 Mini (OAuth)",
"options": {
"reasoningEffort": "low",
"reasoningSummary": "auto",
"textVerbosity": "low",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
},
"gpt-5-nano": {
"name": "GPT 5 Nano (OAuth)",
"options": {
"reasoningEffort": "minimal",
"reasoningSummary": "auto",
"textVerbosity": "low",
"include": [
"reasoning.encrypted_content"
],
"store": false
}
}
}
}
}
}
and no project specific opencode.json rekram1-node commented on 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
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|