feat: add fail-closed Aider development skill
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user