Conversation
- BedrockUsageFetcher.fetchDailyReport — calls Cost Explorer with DAILY granularity over the last 30 days, groups by service, filters for "Bedrock" in service names, and produces CostUsageDailyReport.Entry items with per-model breakdowns - CostUsageFetcher.loadBedrockTokenSnapshot — Bedrock-specific path that bypasses the local file scanner and calls the AWS API directly - 4 UI guards updated — UsageStore.refreshTokenUsage, MenuCardView.tokenUsageSection, StatusItemController+Menu.makeCostHistorySubmenu, and menuCardModel tokenSnapshot wiring all now include .bedrock The Bedrock cost section should now show "Today" and "Last 30 days" values, plus the bar chart submenu with daily cost breakdowns by model (e.g. "Claude Opus 4.6 (Bedrock Edition)").
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cbc6f7745
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let env = ProcessInfo.processInfo.environment | ||
| guard let accessKeyID = BedrockSettingsReader.accessKeyID(environment: env), | ||
| let secretAccessKey = BedrockSettingsReader.secretAccessKey(environment: env) |
There was a problem hiding this comment.
Read Bedrock creds from provider context for cost history
loadBedrockTokenSnapshot pulls credentials from ProcessInfo.processInfo.environment instead of the provider-specific environment assembled from Settings/config overrides, so Bedrock keys saved in the app settings are ignored during cost-history fetches. In practice this makes the main Bedrock usage fetch work (it uses context.env) while the token/cost history section fails with missingCredentials unless AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are exported globally.
Useful? React with 👍 / 👎.
| case .bedrock: | ||
| env[BedrockSettingsReader.accessKeyIDKey] = apiKey | ||
| if let secret = config?.sanitizedCookieHeader, !secret.isEmpty { | ||
| env[BedrockSettingsReader.secretAccessKeyKey] = secret |
There was a problem hiding this comment.
Merge Bedrock secret/region overrides without apiKey guard
The new .bedrock environment mapping is inside a function-level guard that returns early unless config.sanitizedAPIKey is set, so Bedrock-specific fields in config (secretAccessKey/region) are never applied when the access key comes from the shell environment. This breaks mixed setups (e.g., AWS_ACCESS_KEY_ID from env + secret in Settings) and causes credential resolution to fail even though each field is presented as independently configurable.
Useful? React with 👍 / 👎.
AWS Bedrock provider
Added support for AWS Bedrock as a provider. This is using the AWS CE (Cost Explorer) API to retrieve costs of running LLMs, such as Claude Opus 4.6 on AWS Bedrock.
Supports setting a budget via environment variable and fully supports the Cost card in the menu with 30d history: