mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 04:18:19 +00:00
fix(codex): gate ccsxp config overrides
This commit is contained in:
1 parent
c21f589247
commit
e09e930c38
6 files changed
+170
-111
No files matched your search
@@ -289,20 +289,19 @@ export class CodexAdapter implements TargetAdapter {
|
||||
const runtimeConfigOverrides = creds?.runtimeConfigOverrides ?? [];
|
||||
|
||||
if (profileType === 'default') {
|
||||
const modelFlagNormalization = isCcsxpCliproxyShortcut()
|
||||
const isCcsxpShortcut = isCcsxpCliproxyShortcut();
|
||||
const modelFlagNormalization = isCcsxpShortcut
|
||||
? normalizeCcsxpCodexModelFlagAliases(userArgs)
|
||||
: { args: userArgs, overrides: [] };
|
||||
const overrides = [...runtimeConfigOverrides, ...modelFlagNormalization.overrides];
|
||||
if (reasoningOverride) {
|
||||
overrides.push(`model_reasoning_effort=${formatTomlString(reasoningOverride)}`);
|
||||
}
|
||||
if (overrides.length === 0) {
|
||||
return modelFlagNormalization.args;
|
||||
const needsConfigOverrideSupport = isCcsxpShortcut || overrides.length > 0;
|
||||
if (needsConfigOverrideSupport && !codexBinarySupportsConfigOverrides(options?.binaryInfo)) {
|
||||
throw buildConfigOverrideSupportError(hydrateCodexBinaryVersion(options?.binaryInfo));
|
||||
}
|
||||
if (!codexBinarySupportsConfigOverrides(options?.binaryInfo)) {
|
||||
if (reasoningOverride || modelFlagNormalization.overrides.length > 0) {
|
||||
throw buildConfigOverrideSupportError(hydrateCodexBinaryVersion(options?.binaryInfo));
|
||||
}
|
||||
if (overrides.length === 0) {
|
||||
return modelFlagNormalization.args;
|
||||
}
|
||||
return [...buildConfigOverrideArgs(overrides), ...modelFlagNormalization.args];
|
||||
|
||||
Reference in new issue
Block a user