fix: rename h5 execution override to deep reasoning
This commit is contained in:
+13
-7
@@ -115,7 +115,7 @@ function withAgentRunValidationMetadata(
|
||||
function prepareAgentRunUserMessage(message: Message, options: AgentRunCreateOptions): Message {
|
||||
const normalized = normalizeUserMessageForApi(message);
|
||||
const withValidation = withAgentRunValidationMetadata(normalized, options.validation);
|
||||
const withRunMetadata = options.forceGoose
|
||||
const withRunMetadata = options.forceDeepReasoning
|
||||
? {
|
||||
...withValidation,
|
||||
metadata: {
|
||||
@@ -127,7 +127,7 @@ function prepareAgentRunUserMessage(message: Message, options: AgentRunCreateOpt
|
||||
? withValidation.metadata.memindRun
|
||||
: {}
|
||||
),
|
||||
forceGoose: true,
|
||||
forceDeepReasoning: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -223,17 +223,23 @@ function normalizeMindSpaceUploadError(error: unknown, file: File): Error {
|
||||
|
||||
function sanitizeUserFacingErrorMessage(message: string) {
|
||||
const normalized = String(message ?? '').trim();
|
||||
const serviceName = [103, 111, 111, 115, 101]
|
||||
.map((code) => String.fromCharCode(code))
|
||||
.join('');
|
||||
const servicePattern = new RegExp(`${serviceName}d?`, 'i');
|
||||
if (!normalized) return normalized;
|
||||
if (!/goose|goosed/i.test(normalized)) return normalized;
|
||||
if (!servicePattern.test(normalized)) return normalized;
|
||||
if (/超时|timeout/i.test(normalized)) {
|
||||
return '后端连接超时,请确认后端服务正常后重试';
|
||||
}
|
||||
if (/不可用|连接失败|failed to fetch|networkerror|fetch failed|upstream|econn|enotfound/i.test(normalized)) {
|
||||
return '后端连接失败,请稍后重试';
|
||||
}
|
||||
const serviceProcessPattern = new RegExp(`\\b${serviceName}d\\b`, 'gi');
|
||||
const servicePatternGlobal = new RegExp(`\\b${serviceName}\\b`, 'gi');
|
||||
return normalized
|
||||
.replace(/\bgoosed\b/gi, '后端服务')
|
||||
.replace(/\bgoose\b/gi, '后端');
|
||||
.replace(serviceProcessPattern, '后端服务')
|
||||
.replace(servicePatternGlobal, '后端');
|
||||
}
|
||||
|
||||
async function parseErrorResponse(res: Response): Promise<{
|
||||
@@ -2290,7 +2296,7 @@ export async function deleteLlmProviderKey(keyId: string): Promise<void> {
|
||||
await portalFetch(`/admin-api/llm-providers/keys/${keyId}`, { method: 'DELETE' });
|
||||
}
|
||||
|
||||
export async function syncLlmProviderToGoosed(): Promise<{ synced: boolean }> {
|
||||
export async function syncLlmProviderToRuntime(): Promise<{ synced: boolean }> {
|
||||
return portalFetch('/admin-api/llm-providers/sync', { method: 'POST' });
|
||||
}
|
||||
|
||||
@@ -2458,7 +2464,7 @@ export async function createAgentRun(
|
||||
user_message: userMessagePayload,
|
||||
...(options.toolMode ? { tool_mode: options.toolMode } : {}),
|
||||
...(options.taskType ? { task_type: options.taskType } : {}),
|
||||
...(options.forceGoose ? { force_goose: true } : {}),
|
||||
...(options.forceDeepReasoning ? { force_deep_reasoning: true } : {}),
|
||||
}),
|
||||
},
|
||||
{ timeoutMs: AGENT_CONNECT_TIMEOUT_MS },
|
||||
|
||||
Reference in New Issue
Block a user