Files
hapi/cli/src/codex/utils/reasoningEffort.ts
T
ejj.ccandGitHub d160203bb2 fix(codex): support dynamic reasoning efforts (#1012)
* fix(codex): support model-reported reasoning efforts

* fix(web): prevent service worker edge caching

* ci: retrigger stuck Actions run

* fix(codex): accept dynamic reasoning effort values

* fix(web): restore reasoning effort on model switch failure
2026-07-12 18:38:56 +08:00

17 lines
461 B
TypeScript

import type { ReasoningEffort } from '../appServerTypes';
export function parseReasoningEffortValue(value: unknown): ReasoningEffort | undefined {
if (value === null) {
return undefined;
}
if (typeof value !== 'string') {
throw new Error('Invalid model reasoning effort');
}
const effort = value.trim().toLowerCase();
if (!effort) {
throw new Error('Invalid model reasoning effort');
}
return effort;
}