Description
OpenCode's custom provider model configuration accepts numeric token cost rates but does not accept
their currency. The internal assistant-message cost is also stored as a bare number. When OpenCode
projects that number into ACP, it unconditionally emits currency: "USD".
As a result, a custom provider priced in EUR can have the correct numeric amount reported with the
wrong currency. In the deterministic reproduction below, a provider cost of 30 EUR is emitted
as 30 USD.
|
cost: { amount: totalSessionCost(messages), currency: "USD" }, |
Plugins
No response
OpenCode version
OpenCode 1.18.3
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Description
OpenCode's custom provider model configuration accepts numeric token cost rates but does not accept
their currency. The internal assistant-message cost is also stored as a bare number. When OpenCode
projects that number into ACP, it unconditionally emits
currency: "USD".As a result, a custom provider priced in EUR can have the correct numeric amount reported with the
wrong currency. In the deterministic reproduction below, a provider cost of 30 EUR is emitted
as 30 USD.
opencode/packages/opencode/src/acp/usage.ts
Line 212 in aaa42fe
Plugins
No response
OpenCode version
OpenCode 1.18.3
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response