mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 20:28:29 +00:00
chore: apply local workspace updates (#9911)
* chore: apply local workspace updates * fix: resolve prep findings after rebase (#9898) (thanks @gumadeiras) * refactor: centralize model allowlist normalization (#9898) (thanks @gumadeiras) * fix: guard model allowlist initialization (#9911) * docs: update changelog scope for #9911 * docs: remove model names from changelog entry (#9911) * fix: satisfy type-aware lint in model allowlist (#9911)
This commit is contained in:
committed by
GitHub
parent
93b450349f
commit
4629054403
47
src/commands/openai-model-default.ts
Normal file
47
src/commands/openai-model-default.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { ensureModelAllowlistEntry } from "./model-allowlist.js";
|
||||
|
||||
export const OPENAI_DEFAULT_MODEL = "openai/gpt-5.1-codex";
|
||||
|
||||
export function applyOpenAIProviderConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
const next = ensureModelAllowlistEntry({
|
||||
cfg,
|
||||
modelRef: OPENAI_DEFAULT_MODEL,
|
||||
});
|
||||
const models = { ...next.agents?.defaults?.models };
|
||||
models[OPENAI_DEFAULT_MODEL] = {
|
||||
...models[OPENAI_DEFAULT_MODEL],
|
||||
alias: models[OPENAI_DEFAULT_MODEL]?.alias ?? "GPT",
|
||||
};
|
||||
|
||||
return {
|
||||
...next,
|
||||
agents: {
|
||||
...next.agents,
|
||||
defaults: {
|
||||
...next.agents?.defaults,
|
||||
models,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function applyOpenAIConfig(cfg: OpenClawConfig): OpenClawConfig {
|
||||
const next = applyOpenAIProviderConfig(cfg);
|
||||
return {
|
||||
...next,
|
||||
agents: {
|
||||
...next.agents,
|
||||
defaults: {
|
||||
...next.agents?.defaults,
|
||||
model:
|
||||
next.agents?.defaults?.model && typeof next.agents.defaults.model === "object"
|
||||
? {
|
||||
...next.agents.defaults.model,
|
||||
primary: OPENAI_DEFAULT_MODEL,
|
||||
}
|
||||
: { primary: OPENAI_DEFAULT_MODEL },
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user