fix(usage): expired opencode cache after cost writes
- Expired the per-credential usage report cache after recording observed OpenCode Go spend.\n- Threaded provider base URL into OpenCode Go cost recording so the invalidation targets the same cache key /usage uses.\n- Added regression coverage for refreshing cached OpenCode Go limits immediately after a completed turn.\n\nFixes #2942
This commit is contained in:
@@ -2503,6 +2503,7 @@ export class AgentSession {
|
||||
this.#modelRegistry.authStorage.recordUsageCost(assistantMsg.provider, assistantMsg.usage.cost.total, {
|
||||
sessionId: this.#activeProviderSessionId(),
|
||||
recordedAt: assistantMsg.timestamp,
|
||||
baseUrl: this.#modelRegistry.getProviderBaseUrl?.(assistantMsg.provider),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user