fix: map deepseek models for aider
This commit is contained in:
+15
-2
@@ -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',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user