Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

🤖 fix: budget accounting ignores OpenAI service-tier (priority) pricing

Chiusa
#4,352 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Start with displayUsage.ts and models-extra.ts, then trace the callers of createDisplayUsage to see where the effective service tier is available for direct OpenAI and Coder gateway requests. Confirm how budget admission and metering use the catalog, then ensure priority-tier runs are priced correctly or rejected when budgeted until tier pricing exists.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Cost accounting and budget enforcement price every OpenAI request at the model's base rates, regardless of the effective service tier. createDisplayUsage(usage, model, providerMetadata, metadataModelOverride) has no tier input and models-extra.ts carries base-tier rates only, so a goal run with --service-tier priority (a higher-cost tier that the app labels as such) and --budget is admitted and metered as if it ran on the default tier. The represented dollar cap therefore under-counts real spend on priority runs.

Scope

  • Applies to every model that supports OpenAI service tiers (GPT-5.x, GPT-6 Astra/Sol/Luna), on direct OpenAI and the Coder gateway OpenAI path. It is not specific to any single model's pricing entry.
  • Surfaced by Codex security review on #4259 (https://github.com/coder/xum/pull/4259#discussion_r4076486238); deferred there because the fix needs a new accounting input (effective tier) rather than repairing a defect that PR introduced.

Proposed fix (either)

  1. Carry the effective tier into usage accounting: extend createDisplayUsage (or its caller) with the pinned serviceTier and apply per-tier rate multipliers/rates from the catalog.
  2. Or fail closed: reject budgeted runs when the effective tier is non-default until tier pricing exists.

Follow-up trigger

Next change to usage accounting or the OpenAI pricing catalog; owner: whoever next touches displayUsage.ts / models-extra.ts.


Generated with xum • Model: coder:anthropic/claude-fable-5-1 • Thinking: xhigh • Cost: $174.60

Lingua principale
TypeScript
Stelle
2.1k
Fork
142
Merge medio
4h 58m
PR unite (30g)
905

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di coder/xum

Tutte le issue di coder/xum

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.