Repository navigation
Conversation
8cbcf49 to
3140506
Compare
|
@Soju06 It is ready to review. Is there any suggestions on the feature? |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 697386991f
ℹ️ 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".
| configured_model = get_settings().warmup_model | ||
| effective_model = api_key.enforced_model if api_key and api_key.enforced_model else configured_model | ||
| validate_model_access(api_key, effective_model) | ||
| filtered_headers = filter_inbound_headers(headers) |
There was a problem hiding this comment.
Enforce API key usage limits on warmup submissions
warmup() validates only model access and then sends upstream requests for every target account, but it never acquires/finalizes an API-key usage reservation like the normal /v1/responses paths do. In practice, a key that has already hit request/token limits can still call /v1/warmup (especially force) to generate additional upstream traffic, which can drain shared account quota without being blocked by key limits; this commit also tags those calls as request_kind="warmup" and excludes them from usage aggregates, so operators won’t see that spend in key-level totals.
Useful? React with 👍 / 👎.
|
Why tf does github not have a view all button? |
|
Maintainer cleanup: closing this as stale / no longer merge-ready against the current This PR has been open across substantial main-branch churn and is currently carrying at least one stale signal (conflicts/blocked or failing checks, outstanding If the change is still needed, please open a fresh, focused PR rebased on current |
|
Revived on a maintainer-owned branch as #768 because this PR head has maintainerCanModify=false and cannot be updated here. Keeping credit to the original implementation in the replacement PR. |
Purpose
Although there is pending PR (#438) for the Warm up mechanism, I have an another approach to the warm-up implementation, that I am planning to integrate into my Opencode plugin workflow.
This PR is to create an API that warmup the accounts linked to the codex-lb API which
sessionstarts when you called the API), avoid potential session window wasteSpecification
POST /v1/warmupAuthentication: Bearer {codex-lb-key}Body:
or
Authentication: Bearer {codex-lb-key}POST /v1/warmup/${mode}without a body
mode:
normal: send warmup request for accounts that has 5h window and the 5h usage remaining is100%strict: send warmup request only if all accounts have 5h window and the 5h usage remaining is100%, otherwise will not send the requestforce: Force warming up all accounts in the account pool for the API key unconditionallyThe model used is defaulted to
gpt-5.4-mini, which could be changed on the env variable:CODEX_LB_WARMUP_MODELUI change
The warmup request will now tagged on the UI.
