feat: transport resolved reasoning effort

This commit is contained in:
radioflyer28
2026-05-13 18:26:54 -04:00
parent 6ea25ec8c7
commit f70829d067
6 changed files with 51 additions and 4 deletions

View File

@@ -208,8 +208,28 @@ describe('resolveModel', () => {
const planner = (await resolveModel(['gsd-planner'], tmpDir)).data as Record<string, unknown>;
const executor = (await resolveModel(['gsd-executor'], tmpDir)).data as Record<string, unknown>;
expect(planner).toMatchObject({ model: 'gpt-5.5', profile: 'balanced' });
expect(executor).toMatchObject({ model: 'gpt-5.3-codex', profile: 'balanced' });
expect(planner).toMatchObject({ model: 'gpt-5.5', profile: 'balanced', reasoning_effort: 'high' });
expect(executor).toMatchObject({ model: 'gpt-5.3-codex', profile: 'balanced', reasoning_effort: 'medium' });
});
it('returns runtime reasoning_effort from the same phase-tier source as model', async () => {
const { resolveModel } = await import('./config-query.js');
await writeFile(
join(tmpDir, '.planning', 'config.json'),
JSON.stringify({
model_profile: 'budget',
runtime: 'codex',
models: { execution: 'opus' },
}),
);
const executor = (await resolveModel(['gsd-executor'], tmpDir)).data as Record<string, unknown>;
expect(executor).toMatchObject({
model: 'gpt-5.4',
profile: 'budget',
reasoning_effort: 'xhigh',
});
});
it('resolveModel uses workstream config when --ws is specified', async () => {

View File

@@ -222,7 +222,11 @@ export const resolveModel: QueryHandler = async (args, projectDir, workstream) =
const tier = typeof phaseTier === 'string' ? phaseTier : alias;
const runtimeTier = resolveRuntimeTier(config as Record<string, unknown>, tier);
if (runtimeTier?.model) {
return { data: { model: runtimeTier.model, profile } };
const result: Record<string, unknown> = { model: runtimeTier.model, profile };
if (runtimeTier.reasoning_effort) {
result.reasoning_effort = runtimeTier.reasoning_effort;
}
return { data: result };
}
if (resolveModelIds === 'omit') {