From fcba327fdb9d7484ac51daedb4b4dd3a2ea51029 Mon Sep 17 00:00:00 2001 From: Kacper Date: Tue, 30 Dec 2025 14:22:14 +0100 Subject: [PATCH] feat(server): Wire generate-features-from-spec to use phaseModels.featureGenerationModel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass model from settings.phaseModels.featureGenerationModel to createFeatureGenerationOptions(). 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 --- .../routes/app-spec/generate-features-from-spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/server/src/routes/app-spec/generate-features-from-spec.ts b/apps/server/src/routes/app-spec/generate-features-from-spec.ts index e2b7124d..f39d753a 100644 --- a/apps/server/src/routes/app-spec/generate-features-from-spec.ts +++ b/apps/server/src/routes/app-spec/generate-features-from-spec.ts @@ -1,11 +1,15 @@ /** * Generate features from existing app_spec.txt + * + * Model is configurable via phaseModels.featureGenerationModel in settings + * (defaults to Sonnet for balanced speed and quality). */ import { query } from '@anthropic-ai/claude-agent-sdk'; import * as secureFs from '../../lib/secure-fs.js'; import type { EventEmitter } from '../../lib/events.js'; import { createLogger } from '@automaker/utils'; +import { DEFAULT_PHASE_MODELS } from '@automaker/types'; import { createFeatureGenerationOptions } from '../../lib/sdk-options.js'; import { logAuthStatus } from './common.js'; import { parseAndCreateFeatures } from './parse-and-create-features.js'; @@ -101,10 +105,18 @@ IMPORTANT: Do not ask for clarification. The specification is provided above. Ge '[FeatureGeneration]' ); + // Get model from phase settings + const settings = await settingsService?.getGlobalSettings(); + const featureGenerationModel = + settings?.phaseModels?.featureGenerationModel || DEFAULT_PHASE_MODELS.featureGenerationModel; + + logger.info('Using model:', featureGenerationModel); + const options = createFeatureGenerationOptions({ cwd: projectPath, abortController, autoLoadClaudeMd, + model: featureGenerationModel, }); logger.debug('SDK Options:', JSON.stringify(options, null, 2));