fix: map deepseek models for aider

This commit is contained in:
Your Name
2026-07-02 09:42:08 +08:00
parent 21e03d86b5
commit 0cfd2d3d2a
2 changed files with 32 additions and 7 deletions
+15 -2
View File
@@ -386,9 +386,10 @@ function executorEnvForProfile(executor, profile, model, { includeSecret = false
if (includeSecret) common.TKMIND_EXECUTOR_API_KEY = profile.apiKey;
if (executor === 'aider') {
const aiderModel = aiderModelNameForProvider(providerId, model);
const env = {
...common,
AIDER_MODEL: model,
AIDER_MODEL: aiderModel,
};
if (providerId === 'anthropic') {
env.AIDER_ANTHROPIC_API_KEY = apiKeyValue;
@@ -428,6 +429,17 @@ function executorEnvForProfile(executor, profile, model, { includeSecret = false
};
}
function aiderModelNameForProvider(providerId, model) {
const normalizedModel = String(model ?? '').trim();
if (!normalizedModel) return normalizedModel;
if (String(providerId ?? '').trim() === 'custom_deepseek') {
return normalizedModel.startsWith('deepseek/')
? normalizedModel
: `deepseek/${normalizedModel}`;
}
return normalizedModel;
}
function launchLogDir() {
return path.join(os.tmpdir(), 'memindadm-launches');
}
@@ -561,6 +573,7 @@ export function buildExecutorLaunchPlan(runtime, options = {}) {
if (runtime.executor === 'aider') {
const hasInstruction = Boolean(instruction);
const command = resolveExecutorCommand('aider');
const model = aiderModelNameForProvider(env.TKMIND_EXECUTOR_PROVIDER, runtime.model);
return {
ok: true,
executor: 'aider',
@@ -568,7 +581,7 @@ export function buildExecutorLaunchPlan(runtime, options = {}) {
command,
args: [
'--model',
runtime.model,
model,
...(hasInstruction ? ['--message', instruction] : []),
'--yes-always',
],