mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-09-11 06:37:47 +08:00
- Add `model-level-cooling` configuration option to Codex settings. - Scope `usage_limit_reached` quota cooldowns to the requested model instead of the entire credential when enabled. - Propagate model-level cooling checks across HTTP, SSE, and WebSocket execution paths. Closes: #5619
18 lines
579 B
Go
18 lines
579 B
Go
package executor
|
|
|
|
import "github.com/router-for-me/CLIProxyAPI/v7/internal/config"
|
|
|
|
// CodexExecutor is a stateless executor for Codex (OpenAI Responses API entrypoint).
|
|
// If api_key is unavailable on auth, it falls back to legacy via ClientAdapter.
|
|
type CodexExecutor struct {
|
|
cfg *config.Config
|
|
}
|
|
|
|
func NewCodexExecutor(cfg *config.Config) *CodexExecutor { return &CodexExecutor{cfg: cfg} }
|
|
|
|
func (e *CodexExecutor) Identifier() string { return "codex" }
|
|
|
|
func (e *CodexExecutor) modelLevelCooling() bool {
|
|
return e != nil && e.cfg != nil && e.cfg.Codex.ModelLevelCooling
|
|
}
|