feat: add fail-closed Aider development skill

This commit is contained in:
john
2026-07-24 19:48:04 +08:00
parent 1c82b34ad9
commit be9c25f1d0
15 changed files with 320 additions and 7 deletions
+6 -1
View File
@@ -3,6 +3,7 @@ import type { MindSpaceChatContext, AgentCodeRunClientPolicy } from '../types';
export type AgentRunCreateOptions = {
toolMode?: 'chat' | 'code';
taskType?: string | null;
executor?: 'aider' | 'openhands';
forceDeepReasoning?: boolean;
validation?: AgentRunValidation | null;
validationInstruction?: string | null;
@@ -299,6 +300,7 @@ export function resolveAgentRunOptions(
}: {
taskType?: string;
forceCode?: boolean;
requiredExecutor?: 'aider' | 'openhands';
allowAutodetect?: boolean;
allowPageDataDevAutodetect?: boolean;
userId?: string | null;
@@ -313,15 +315,17 @@ export function resolveAgentRunOptions(
const effectiveTaskType = pageDataDevTaskType ?? taskType;
const shouldUseDeepReasoning =
forceCode ||
Boolean(requiredExecutor) ||
Boolean(pageDataDevTaskType) ||
DEEP_REASONING_TASK_PATTERNS.some((pattern) => pattern.test(normalizedText));
if (!agentCodeRunsEnabledForUser(userId)) {
if (!agentCodeRunsEnabledForUser(userId) && !requiredExecutor) {
return shouldUseDeepReasoning ? { forceDeepReasoning: true, taskType: effectiveTaskType } : {};
}
const shouldUseCode =
forceCode ||
Boolean(requiredExecutor) ||
Boolean(pageDataDevTaskType) ||
(allowAutodetect && CODE_TASK_PATTERNS.some((pattern) => pattern.test(normalizedText)));
if (!shouldUseCode) {
@@ -339,6 +343,7 @@ export function resolveAgentRunOptions(
return {
toolMode: 'code',
taskType: effectiveTaskType,
...(requiredExecutor ? { executor: requiredExecutor } : {}),
forceDeepReasoning: true,
validation: mergeAgentRunValidationFiles(receipt.validation, taskValidation.validation),
validationInstruction: `${receipt.instruction}${taskValidation.instruction}`,