mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-23 12:03:07 +00:00
fix: Address review comments
This commit is contained in:
@@ -350,7 +350,7 @@ export class ClaudeProvider extends BaseProvider {
|
||||
provider: 'anthropic',
|
||||
description: 'Balanced performance and cost with enhanced reasoning',
|
||||
contextWindow: 200000,
|
||||
maxOutputTokens: 128000,
|
||||
maxOutputTokens: 64000,
|
||||
supportsVision: true,
|
||||
supportsTools: true,
|
||||
tier: 'standard' as const,
|
||||
|
||||
@@ -212,7 +212,6 @@ async function resolveCodexExecutionPlan(options: ExecuteOptions): Promise<Codex
|
||||
// authIndicators.hasApiKey = API key stored in Codex's own auth file (via `codex login --api-key`)
|
||||
// Both are "CLI-native" auth — distinct from an API key stored in Automaker's credentials.
|
||||
const hasCliNativeAuth = authIndicators.hasOAuthToken || authIndicators.hasApiKey;
|
||||
const cliAuthenticated = hasCliNativeAuth || hasApiKey;
|
||||
const sdkEligible = isSdkEligible(options);
|
||||
|
||||
// If CLI is available and the user authenticated via the CLI (`codex login`),
|
||||
@@ -767,7 +766,7 @@ export class CodexProvider extends BaseProvider {
|
||||
codexSettings.enableWebSearch || resolveSearchEnabled(resolvedAllowedTools, restrictTools);
|
||||
await writeOutputSchemaFile(options.cwd, options.outputFormat);
|
||||
const imageBlocks = codexSettings.enableImages ? extractImageBlocks(options.prompt) : [];
|
||||
await writeImageFiles(options.cwd, imageBlocks);
|
||||
const imagePaths = await writeImageFiles(options.cwd, imageBlocks);
|
||||
const approvalPolicy =
|
||||
hasMcpServers && options.mcpAutoApproveTools !== undefined
|
||||
? options.mcpAutoApproveTools
|
||||
@@ -810,6 +809,12 @@ export class CodexProvider extends BaseProvider {
|
||||
}
|
||||
}
|
||||
|
||||
// If images were written to disk, add the image directory so the CLI can access them
|
||||
if (imagePaths.length > 0) {
|
||||
const imageDir = path.join(options.cwd, CODEX_INSTRUCTIONS_DIR, IMAGE_TEMP_DIR);
|
||||
preExecArgs.push(CODEX_ADD_DIR_FLAG, imageDir);
|
||||
}
|
||||
|
||||
// Model is already bare (no prefix) - validated by executeQuery
|
||||
const args = [
|
||||
CODEX_EXEC_SUBCOMMAND,
|
||||
|
||||
@@ -464,7 +464,7 @@ export class OpencodeProvider extends CliProvider {
|
||||
// Without this guard, errors like "ProviderModelNotFoundError" or
|
||||
// "Resource not found: /path/to/config.json" would false-positive.
|
||||
if (cleaned.includes('notfounderror') || cleaned.includes('resource not found')) {
|
||||
return cleaned.includes('/session/') || cleaned.includes('session');
|
||||
return cleaned.includes('/session/') || /\bsession\b/.test(cleaned);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -720,11 +720,29 @@ export class OpencodeProvider extends CliProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Final completion (reason: 'stop' or 'end_turn')
|
||||
// Only treat an explicit allowlist of reasons as true success.
|
||||
// Reasons like 'length' (context-window truncation) or 'content-filter'
|
||||
// indicate the model stopped abnormally and must not be surfaced as
|
||||
// successful completions.
|
||||
const SUCCESS_REASONS = new Set(['stop', 'end_turn']);
|
||||
const reason = finishEvent.part?.reason;
|
||||
|
||||
if (reason === undefined || SUCCESS_REASONS.has(reason)) {
|
||||
// Final completion (reason: 'stop', 'end_turn', or unset)
|
||||
return {
|
||||
type: 'result',
|
||||
subtype: 'success',
|
||||
session_id: finishEvent.sessionID,
|
||||
result: (finishEvent.part as OpenCodePart & { result?: string })?.result,
|
||||
};
|
||||
}
|
||||
|
||||
// Non-success, non-tool-calls reason (e.g. 'length', 'content-filter')
|
||||
return {
|
||||
type: 'result',
|
||||
subtype: 'success',
|
||||
subtype: 'error',
|
||||
session_id: finishEvent.sessionID,
|
||||
error: `Step finished with non-success reason: ${reason}`,
|
||||
result: (finishEvent.part as OpenCodePart & { result?: string })?.result,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user