mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-06 06:41:56 +00:00
@@ -4,6 +4,21 @@ import { initializeToken } from '@/ui/tokenInit'
|
||||
import { maybeAutoStartServer } from '@/utils/autoStartServer'
|
||||
import type { CommandDefinition } from './types'
|
||||
import type { CodexPermissionMode } from '@hapi/protocol/types'
|
||||
import type { ReasoningEffort } from '@/codex/appServerTypes'
|
||||
|
||||
function parseReasoningEffort(value: string): ReasoningEffort {
|
||||
switch (value) {
|
||||
case 'none':
|
||||
case 'minimal':
|
||||
case 'low':
|
||||
case 'medium':
|
||||
case 'high':
|
||||
case 'xhigh':
|
||||
return value
|
||||
default:
|
||||
throw new Error('Invalid --model-reasoning-effort value')
|
||||
}
|
||||
}
|
||||
|
||||
export const codexCommand: CommandDefinition = {
|
||||
name: 'codex',
|
||||
@@ -18,7 +33,7 @@ export const codexCommand: CommandDefinition = {
|
||||
permissionMode?: CodexPermissionMode
|
||||
resumeSessionId?: string
|
||||
model?: string
|
||||
modelReasoningEffort?: string
|
||||
modelReasoningEffort?: ReasoningEffort
|
||||
} = {}
|
||||
const unknownArgs: string[] = []
|
||||
|
||||
@@ -50,7 +65,7 @@ export const codexCommand: CommandDefinition = {
|
||||
if (!effort) {
|
||||
throw new Error('Missing --model-reasoning-effort value')
|
||||
}
|
||||
options.modelReasoningEffort = effort
|
||||
options.modelReasoningEffort = parseReasoningEffort(effort)
|
||||
} else {
|
||||
unknownArgs.push(arg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user