Skip to content

fix(stats): map CORTEX_PRICING env keys to provider/model names#151

Open
hechibing wants to merge 1 commit intoCortexLM:mainfrom
hechibing:fix/pricing-provider-model-env-11201
Open

fix(stats): map CORTEX_PRICING env keys to provider/model names#151
hechibing wants to merge 1 commit intoCortexLM:mainfrom
hechibing:fix/pricing-provider-model-env-11201

Conversation

@hechibing
Copy link

Summary

  • add model suffix normalization for CORTEX_PRICING_* keys
  • support provider/model mapping for common format:
    • CORTEX_PRICING_OPENAI_GPT_4O -> openai/gpt-4o
  • keep legacy hyphen mapping for backward compatibility
  • add tests for provider/model and explicit slash mapping cases

Why

Custom pricing env vars were normalized to hyphen-only names, which did not match provider/model identifiers and silently disabled overrides.

Validation

  • cargo test -p cortex-cli model_names_from_env_suffix -- --nocapture

Related bounty report: PlatformNetwork/bounty-challenge#11201

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant