mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-17 03:20:40 +00:00
fix(codex): apply reasoning effort correctly
This commit is contained in:
@@ -130,6 +130,7 @@ describe('appServerConfig', () => {
|
||||
mode: 'default',
|
||||
settings: {
|
||||
model: 'o3',
|
||||
reasoning_effort: 'high',
|
||||
developer_instructions: withCollaborationInstructions(codexSystemPrompt)
|
||||
}
|
||||
});
|
||||
@@ -155,6 +156,7 @@ describe('appServerConfig', () => {
|
||||
mode: 'default',
|
||||
settings: {
|
||||
model: 'gpt-5.3-codex-spark',
|
||||
reasoning_effort: 'high',
|
||||
developer_instructions: withCollaborationInstructions(codexSystemPrompt)
|
||||
}
|
||||
});
|
||||
@@ -236,6 +238,7 @@ describe('appServerConfig', () => {
|
||||
mode: 'plan',
|
||||
settings: {
|
||||
model: 'o3',
|
||||
reasoning_effort: 'high',
|
||||
developer_instructions: withCollaborationInstructions(codexSystemPrompt)
|
||||
}
|
||||
});
|
||||
@@ -255,6 +258,7 @@ describe('appServerConfig', () => {
|
||||
mode: 'plan',
|
||||
settings: {
|
||||
model: 'o3',
|
||||
reasoning_effort: null,
|
||||
developer_instructions: withCollaborationInstructions(`${codexSystemPrompt}\n\nOnly respond in Chinese.`)
|
||||
}
|
||||
});
|
||||
@@ -299,6 +303,7 @@ describe('appServerConfig', () => {
|
||||
mode: 'default',
|
||||
settings: {
|
||||
model: 'o3',
|
||||
reasoning_effort: null,
|
||||
developer_instructions: withCollaborationInstructions(codexSystemPrompt)
|
||||
}
|
||||
});
|
||||
@@ -319,6 +324,7 @@ describe('appServerConfig', () => {
|
||||
mode: 'default',
|
||||
settings: {
|
||||
model: 'o3',
|
||||
reasoning_effort: null,
|
||||
developer_instructions: withCollaborationInstructions(codexSystemPrompt)
|
||||
}
|
||||
});
|
||||
@@ -338,6 +344,7 @@ describe('appServerConfig', () => {
|
||||
mode: 'default',
|
||||
settings: {
|
||||
model: 'gpt-5',
|
||||
reasoning_effort: null,
|
||||
developer_instructions: withCollaborationInstructions(codexSystemPrompt)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -168,9 +168,10 @@ export function buildTurnStartParams(args: {
|
||||
? undefined
|
||||
: args.mode?.collaborationMode;
|
||||
const model = args.overrides?.model ?? args.mode?.model;
|
||||
const modelReasoningEffort = args.mode?.modelReasoningEffort;
|
||||
|
||||
if (args.mode?.modelReasoningEffort) {
|
||||
params.effort = args.mode.modelReasoningEffort;
|
||||
if (modelReasoningEffort) {
|
||||
params.effort = modelReasoningEffort;
|
||||
if (!collaborationMode && supportsReasoningSummary(model)) {
|
||||
params.summary = 'detailed';
|
||||
}
|
||||
@@ -185,6 +186,7 @@ export function buildTurnStartParams(args: {
|
||||
mode: collaborationMode,
|
||||
settings: {
|
||||
model,
|
||||
reasoning_effort: modelReasoningEffort ?? null,
|
||||
developer_instructions: appendCollaborationInstructions(developerInstructions)
|
||||
}
|
||||
};
|
||||
|
||||
@@ -151,3 +151,7 @@ export function buildDeveloperInstructionsArg(instructions: string): string[] {
|
||||
const escaped = escapeTomlString(instructions);
|
||||
return ['-c', `developer_instructions="${escaped}"`];
|
||||
}
|
||||
|
||||
export function buildModelReasoningEffortConfigArgs(effort: string): string[] {
|
||||
return ['-c', `model_reasoning_effort="${escapeTomlString(effort)}"`];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user