fix: rename h5 execution override to deep reasoning

This commit is contained in:
john
2026-07-04 14:57:13 +08:00
parent 12268110f7
commit e4657c7e55
13 changed files with 79 additions and 73 deletions
+8 -8
View File
@@ -155,7 +155,7 @@ async function validateToolGatewayResult({ result, validation, cwd }) {
return { expectedFiles: checks };
}
function withRunMetadata(userMessage, { toolMode = 'chat', taskType = null, forceGoose = false } = {}) {
function withRunMetadata(userMessage, { toolMode = 'chat', taskType = null, forceDeepReasoning = false } = {}) {
const message = (userMessage && typeof userMessage === 'object' && !Array.isArray(userMessage))
? { ...userMessage }
: { value: userMessage };
@@ -168,7 +168,7 @@ function withRunMetadata(userMessage, { toolMode = 'chat', taskType = null, forc
: {}),
toolMode: normalizeAgentRunToolMode(toolMode),
...(taskType ? { taskType } : {}),
...(forceGoose ? { forceGoose: true } : {}),
...(forceDeepReasoning ? { forceDeepReasoning: true } : {}),
};
return { ...message, metadata };
}
@@ -185,7 +185,7 @@ function getRunOptionsFromMessage(userMessage) {
return {
toolMode,
taskType: normalizeTaskType(runMetadata?.taskType ?? metadata?.taskType),
forceGoose: runMetadata?.forceGoose === true || metadata?.forceGoose === true,
forceDeepReasoning: runMetadata?.forceDeepReasoning === true || metadata?.forceDeepReasoning === true,
validation: normalizeToolGatewayValidation(runMetadata?.validation ?? metadata?.toolGatewayValidation),
};
}
@@ -289,7 +289,7 @@ export function createAgentRunGateway({
userMessage,
toolMode = 'chat',
taskType = null,
forceGoose = false,
forceDeepReasoning = false,
}) {
const normalizedRequestId = String(requestId ?? '').trim();
if (!normalizedRequestId) {
@@ -308,7 +308,7 @@ export function createAgentRunGateway({
const runMessage = withRunMetadata(userMessage, {
toolMode: normalizedToolMode,
taskType: normalizedTaskType,
forceGoose,
forceDeepReasoning,
});
await pool.query(
`INSERT INTO h5_agent_runs
@@ -329,7 +329,7 @@ export function createAgentRunGateway({
sessionId: sessionId || null,
toolMode: normalizedToolMode,
taskType: normalizedTaskType,
forceGoose: Boolean(forceGoose),
forceDeepReasoning: Boolean(forceDeepReasoning),
});
if (autoDispatch) dispatchRun(runId);
return projectRun(await getRunById(runId));
@@ -391,7 +391,7 @@ export function createAgentRunGateway({
const userMessage = safeJsonParse(row.user_message_json, {});
const runOptions = getRunOptionsFromMessage(userMessage);
const toolGatewayStatus = toolGateway?.getStatus ? toolGateway.getStatus() : null;
if (!runOptions.forceGoose && directChatService?.canHandle?.({
if (!runOptions.forceDeepReasoning && directChatService?.canHandle?.({
sessionId: row.agent_session_id ?? null,
toolMode: runOptions.toolMode,
userMessage,
@@ -467,7 +467,7 @@ export function createAgentRunGateway({
let sessionId = row.agent_session_id ?? null;
if (isDirectChatSessionId(sessionId)) {
await appendEvent(runId, 'direct_session_escalated_to_goose', {
await appendEvent(runId, 'direct_session_escalated_to_deep_reasoning', {
previousSessionId: sessionId,
});
sessionId = null;