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
There is an example of pretty simple session.json
There is a 1 call saying hello to the agent inside the opencode sources. And even with that, the context length is already 10k.
If I dump the entire session.json file into the OpenRouter chat, context length will be 5k, half of it.
Are there any hidden data sent to the provider/model which is not tracked inside session file?
@geril07 what is likely causing extra context that isn't necessarily in the session.json is the tool definitions (along with mcp server tools if you have any).
opencode ships with a variety of tools by default, each one has a JSON input schema, a name, a description, and then often a description for the different fields that can be passed to it.
Due to that these do require additional tokens / cost and wouldn't be present when interacting just directly with llm without any tools. So that probably explains the context difference.
Yeah, that's logical. It would be nice to have an option to inspect the entire context, which was requested in #2666.
Closing as a duplicate then, thanks.
Activity
github-actions commentedon Sep 28, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Sep 28, 2025
@geril07 what is likely causing extra context that isn't necessarily in the session.json is the tool definitions (along with mcp server tools if you have any).
opencode ships with a variety of tools by default, each one has a JSON input schema, a name, a description, and then often a description for the different fields that can be passed to it.
Due to that these do require additional tokens / cost and wouldn't be present when interacting just directly with llm without any tools. So that probably explains the context difference.
geril07 commentedon Sep 28, 2025
Yeah, that's logical. It would be nice to have an option to inspect the entire context, which was requested in #2666.
Closing as a duplicate then, thanks.