diff --git a/apps/server/src/providers/simple-query-service.ts b/apps/server/src/providers/simple-query-service.ts index b37ef732..5882b96f 100644 --- a/apps/server/src/providers/simple-query-service.ts +++ b/apps/server/src/providers/simple-query-service.ts @@ -15,7 +15,13 @@ */ import { ProviderFactory } from './provider-factory.js'; -import type { ProviderMessage, ContentBlock, ThinkingLevel } from '@automaker/types'; +import type { + ProviderMessage, + ContentBlock, + ThinkingLevel, + ReasoningEffort, +} from '@automaker/types'; +import { stripProviderPrefix } from '@automaker/types'; /** * Options for simple query execution @@ -42,6 +48,8 @@ export interface SimpleQueryOptions { }; /** Thinking level for Claude models */ thinkingLevel?: ThinkingLevel; + /** Reasoning effort for Codex/OpenAI models */ + reasoningEffort?: ReasoningEffort; /** If true, runs in read-only mode (no file writes) */ readOnly?: boolean; /** Setting sources for CLAUDE.md loading */ @@ -97,6 +105,7 @@ const DEFAULT_MODEL = 'claude-sonnet-4-20250514'; export async function simpleQuery(options: SimpleQueryOptions): Promise { const model = options.model || DEFAULT_MODEL; const provider = ProviderFactory.getProviderForModel(model); + const bareModel = stripProviderPrefix(model); let responseText = ''; let structuredOutput: Record | undefined; @@ -104,7 +113,8 @@ export async function simpleQuery(options: SimpleQueryOptions): Promise { const model = options.model || DEFAULT_MODEL; const provider = ProviderFactory.getProviderForModel(model); + const bareModel = stripProviderPrefix(model); let responseText = ''; let structuredOutput: Record | undefined; @@ -183,7 +195,8 @@ export async function streamingQuery(options: StreamingQueryOptions): Promise Promise<{ success: boolean; message?: string; issueNumber?: number; error?: string }>; /** Check validation status for an issue or all issues */ getValidationStatus: ( @@ -1294,6 +1298,7 @@ interface SetupAPI { success: boolean; hasAnthropicKey: boolean; hasGoogleKey: boolean; + hasOpenaiKey: boolean; }>; deleteApiKey: ( provider: string @@ -1377,6 +1382,7 @@ function createMockSetupAPI(): SetupAPI { success: true, hasAnthropicKey: false, hasGoogleKey: false, + hasOpenaiKey: false, }; }, @@ -3008,8 +3014,20 @@ function createMockGitHubAPI(): GitHubAPI { mergedPRs: [], }; }, - validateIssue: async (projectPath: string, issue: IssueValidationInput, model?: AgentModel) => { - console.log('[Mock] Starting async validation:', { projectPath, issue, model }); + validateIssue: async ( + projectPath: string, + issue: IssueValidationInput, + model?: ModelId, + thinkingLevel?: ThinkingLevel, + reasoningEffort?: ReasoningEffort + ) => { + console.log('[Mock] Starting async validation:', { + projectPath, + issue, + model, + thinkingLevel, + reasoningEffort, + }); // Simulate async validation in background setTimeout(() => { diff --git a/apps/ui/src/lib/http-api-client.ts b/apps/ui/src/lib/http-api-client.ts index e2333520..e90b347a 100644 --- a/apps/ui/src/lib/http-api-client.ts +++ b/apps/ui/src/lib/http-api-client.ts @@ -36,6 +36,7 @@ import type { import type { Message, SessionListItem } from '@/types/electron'; import type { Feature, ClaudeUsageResponse, CodexUsageResponse } from '@/store/app-store'; import type { WorktreeAPI, GitAPI, ModelDefinition, ProviderStatus } from '@/types/electron'; +import type { ModelId, ThinkingLevel, ReasoningEffort } from '@automaker/types'; import { getGlobalFileBrowser } from '@/contexts/file-browser-context'; const logger = createLogger('HttpClient'); @@ -1173,6 +1174,7 @@ export class HttpApiClient implements ElectronAPI { success: boolean; hasAnthropicKey: boolean; hasGoogleKey: boolean; + hasOpenaiKey: boolean; }> => this.get('/api/setup/api-keys'), getPlatform: (): Promise<{ @@ -1838,9 +1840,17 @@ export class HttpApiClient implements ElectronAPI { validateIssue: ( projectPath: string, issue: IssueValidationInput, - model?: string, - thinkingLevel?: string - ) => this.post('/api/github/validate-issue', { projectPath, ...issue, model, thinkingLevel }), + model?: ModelId, + thinkingLevel?: ThinkingLevel, + reasoningEffort?: ReasoningEffort + ) => + this.post('/api/github/validate-issue', { + projectPath, + ...issue, + model, + thinkingLevel, + reasoningEffort, + }), getValidationStatus: (projectPath: string, issueNumber?: number) => this.post('/api/github/validation-status', { projectPath, issueNumber }), stopValidation: (projectPath: string, issueNumber: number) => diff --git a/libs/platform/src/subprocess.ts b/libs/platform/src/subprocess.ts index 7634dc5c..4fad5412 100644 --- a/libs/platform/src/subprocess.ts +++ b/libs/platform/src/subprocess.ts @@ -190,7 +190,7 @@ export async function* spawnJSONLProcess(options: SubprocessOptions): AsyncGener * Spawns a subprocess and collects all output */ export async function spawnProcess(options: SubprocessOptions): Promise { - const { command, args, cwd, env, abortController } = options; + const { command, args, cwd, env, abortController, stdinData } = options; const processEnv = { ...process.env, @@ -204,10 +204,15 @@ export async function spawnProcess(options: SubprocessOptions): Promise