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:
roboomp
2026-06-18 07:52:45 +00:00
parent e5b35d38a7
commit 9e7bb85411
3 changed files with 24 additions and 1 deletions
@@ -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),
});
}
}