mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
feat(server): Wire generate-spec to use phaseModels.specGenerationModel
Pass model from settings.phaseModels.specGenerationModel to createSpecGenerationOptions(). Falls back to DEFAULT_PHASE_MODELS if settings unavailable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Generate app_spec.txt from project overview
|
* Generate app_spec.txt from project overview
|
||||||
|
*
|
||||||
|
* Model is configurable via phaseModels.specGenerationModel in settings
|
||||||
|
* (defaults to Opus for high-quality specification generation).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { query } from '@anthropic-ai/claude-agent-sdk';
|
import { query } from '@anthropic-ai/claude-agent-sdk';
|
||||||
@@ -13,6 +16,7 @@ import {
|
|||||||
type SpecOutput,
|
type SpecOutput,
|
||||||
} from '../../lib/app-spec-format.js';
|
} from '../../lib/app-spec-format.js';
|
||||||
import { createLogger } from '@automaker/utils';
|
import { createLogger } from '@automaker/utils';
|
||||||
|
import { DEFAULT_PHASE_MODELS } from '@automaker/types';
|
||||||
import { createSpecGenerationOptions } from '../../lib/sdk-options.js';
|
import { createSpecGenerationOptions } from '../../lib/sdk-options.js';
|
||||||
import { logAuthStatus } from './common.js';
|
import { logAuthStatus } from './common.js';
|
||||||
import { generateFeaturesFromSpec } from './generate-features-from-spec.js';
|
import { generateFeaturesFromSpec } from './generate-features-from-spec.js';
|
||||||
@@ -93,10 +97,18 @@ ${getStructuredSpecPromptInstruction()}`;
|
|||||||
'[SpecRegeneration]'
|
'[SpecRegeneration]'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Get model from phase settings
|
||||||
|
const settings = await settingsService?.getGlobalSettings();
|
||||||
|
const specGenerationModel =
|
||||||
|
settings?.phaseModels?.specGenerationModel || DEFAULT_PHASE_MODELS.specGenerationModel;
|
||||||
|
|
||||||
|
logger.info('Using model:', specGenerationModel);
|
||||||
|
|
||||||
const options = createSpecGenerationOptions({
|
const options = createSpecGenerationOptions({
|
||||||
cwd: projectPath,
|
cwd: projectPath,
|
||||||
abortController,
|
abortController,
|
||||||
autoLoadClaudeMd,
|
autoLoadClaudeMd,
|
||||||
|
model: specGenerationModel,
|
||||||
outputFormat: {
|
outputFormat: {
|
||||||
type: 'json_schema',
|
type: 'json_schema',
|
||||||
schema: specOutputSchema,
|
schema: specOutputSchema,
|
||||||
|
|||||||
Reference in New Issue
Block a user