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
It seems OpenCode sends two times the system prompt at the beginning of the conversation. The second time includes the <env> information, and the first is just the provider system prompt. I have only been able to test this with Azure OpenAI models, but from the code, I would suspect to happen for everything.
Run opencode like so: HTTP_PROXY=http://127.0.0.1:8080 HTTPS_PROXY=http://127.0.0.1:8080 NODE_EXTRA_CA_CERTS="$HOME/.mitmproxy/mitmproxy-ca-cert.pem" opencode
After the first message, you can see in the browser the requests intercepted by opencode. When I look at them, they look like this (trimming irrelevant stuff):
Checking the diffs, between these two system messages, the only difference is:
Here is some useful information about the environment you are running in:
<env>
Working directory: /Users/bernat/.config/opencode
Is directory a git repo: no
Platform: darwin
Today's date: Fri Jul 25 2025
</env>
<project>
</project>
This, as expected, is repeated for every subsequent request of the conversation
$ opencode --version
0.3.67
Suspicion
I do not know enough about the caching mechanisms, so uncertain about opening a PR. But it looks to me like this line is duplicating the functionality immediately above. After removing it, I can see how there is two system messages: the first contains whatever the system prompt is, and the second the env info. I'd assume this to be correct?
Activity
thdxr commentedon Jul 25, 2025
yep i introduced this error - pushed a fix will release soon
feat(app): OpenWork Cloud team skills catalog on Skills page (anomaly…