fix(server): recover missing initial Codex usage tiers #21899
main fromrefs/pull/21899/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
juliusmarminge changed the title
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change
github-actions[bot](GitHub profile, opens in a new tab) removed labels📱 Native Change
- apps/server/src/usage/CodexUsageHistory.ts line 15OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +1,15 @@1+import { ModelSelection } from "@t3tools/contracts";2+import type { UsageSpeed } from "@t3tools/provider-core/server/usage";3+import * as NodeSqliteClient from "@t3tools/shared/nodeSqliteClient";4+import * as Context from "effect/Context";5+import * as Effect from "effect/Effect";6+import * as Layer from "effect/Layer";7+import * as Option from "effect/Option";8+import * as Schema from "effect/Schema";9+import * as SqlClient from "effect/sql/SqlClient";10+11+import { getCodexServiceTierOptionValue } from "../codexModelOptions.ts";12+13+export class CodexUsageHistoryReadError extends Schema.TaggedError<CodexUsageHistoryReadError>()(14+ "CodexUsageHistoryReadError",15+ { cause: Schema.Defect() },
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XXL
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge merged thisd243b09
juliusmarminge closed this
Sign in to join this conversation.


Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This PR changes production Codex usage parsing, historical reconciliation, and persisted cache data, potentially changing reported token costs for existing activity. The SQL lookup and cross-scan cache behavior warrant maintainer review of the accounting impact.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).