From 844a9b57ab96d4ed692d2a6c3eda755a23e33810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CBeeRad=E2=80=9D?= Date: Thu, 29 Jan 2026 15:20:35 +1100 Subject: [PATCH] feat(rah-light): remove delegateToWiseRAH orchestration tool - Deleted src/tools/orchestration/delegateToWiseRAH.ts - Removed delegateToWiseRAH from registry.ts and groups.ts - Deleted tests/evals/scenarios/delegate-wise.ts and delegate-mini.ts - Updated tests/evals/scenarios/index.ts to remove deleted test imports Co-Authored-By: Claude Opus 4.5 --- src/tools/infrastructure/groups.ts | 1 - src/tools/infrastructure/registry.ts | 3 -- src/tools/orchestration/delegateToWiseRAH.ts | 36 -------------------- tests/evals/scenarios/delegate-mini.ts | 15 -------- tests/evals/scenarios/delegate-wise.ts | 15 -------- tests/evals/scenarios/index.ts | 4 --- 6 files changed, 74 deletions(-) delete mode 100644 src/tools/orchestration/delegateToWiseRAH.ts delete mode 100644 tests/evals/scenarios/delegate-mini.ts delete mode 100644 tests/evals/scenarios/delegate-wise.ts diff --git a/src/tools/infrastructure/groups.ts b/src/tools/infrastructure/groups.ts index 9dedac1..13813a7 100644 --- a/src/tools/infrastructure/groups.ts +++ b/src/tools/infrastructure/groups.ts @@ -45,7 +45,6 @@ export const TOOL_GROUP_ASSIGNMENTS: Record = { // Orchestration: Workflows and reasoning (orchestrator only) webSearch: 'orchestration', think: 'orchestration', - delegateToWiseRAH: 'orchestration', executeWorkflow: 'orchestration', listWorkflows: 'orchestration', getWorkflow: 'orchestration', diff --git a/src/tools/infrastructure/registry.ts b/src/tools/infrastructure/registry.ts index ee050a9..1af6883 100644 --- a/src/tools/infrastructure/registry.ts +++ b/src/tools/infrastructure/registry.ts @@ -16,7 +16,6 @@ import { queryDimensionNodesTool } from '../database/queryDimensionNodes'; import { searchContentEmbeddingsTool } from '../other/searchContentEmbeddings'; import { webSearchTool } from '../other/webSearch'; import { thinkTool } from '../other/think'; -import { delegateToWiseRAHTool } from '../orchestration/delegateToWiseRAH'; import { executeWorkflowTool } from '../orchestration/executeWorkflow'; import { listWorkflowsTool } from '../orchestration/listWorkflows'; import { getWorkflowTool } from '../orchestration/getWorkflow'; @@ -42,7 +41,6 @@ const CORE_TOOLS: Record = { const ORCHESTRATION_TOOLS: Record = { webSearch: webSearchTool, think: thinkTool, - delegateToWiseRAH: delegateToWiseRAHTool, executeWorkflow: executeWorkflowTool, listWorkflows: listWorkflowsTool, getWorkflow: getWorkflowTool, @@ -98,7 +96,6 @@ const ORCHESTRATOR_TOOL_NAMES = Array.from(new Set([ const EXECUTOR_TOOL_NAMES = [ ...Object.keys(CORE_TOOLS), ...Object.keys(ORCHESTRATION_TOOLS).filter(name => - name !== 'delegateToWiseRAH' && name !== 'executeWorkflow' ), ...Object.keys(EXECUTION_TOOLS), diff --git a/src/tools/orchestration/delegateToWiseRAH.ts b/src/tools/orchestration/delegateToWiseRAH.ts deleted file mode 100644 index 6e424cb..0000000 --- a/src/tools/orchestration/delegateToWiseRAH.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { tool } from 'ai'; -import { z } from 'zod'; -import { WorkflowExecutor } from '@/services/agents/workflowExecutor'; -import { RequestContext } from '@/services/context/requestContext'; - -export const delegateToWiseRAHTool = tool({ - description: 'Delegate complex workflows to workflow executor', - inputSchema: z.object({ - task: z.string().describe('Complex workflow description: what needs to be planned and executed'), - context: z.array(z.string()).max(8).default([]).describe('Optional context: node IDs, URLs, or key information the planner needs'), - expectedOutcome: z.string().optional().describe('Optional: what final result or format you expect in the summary'), - workflowKey: z.string().optional().describe('Optional: workflow key if invoked via executeWorkflow'), - workflowNodeId: z.number().optional().describe('Optional: target node ID for workflow'), - }), - execute: async ({ task, context = [], expectedOutcome, workflowKey, workflowNodeId }) => { - const requestContext = RequestContext.get(); - console.log('[delegateToWiseRAH] Current traceId:', requestContext.traceId); - - const sessionId = `workflow_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`; - - const execution = await WorkflowExecutor.execute({ - sessionId, - task, - context, - expectedOutcome, - traceId: requestContext.traceId, - parentChatId: requestContext.parentChatId, - workflowKey, - workflowNodeId, - }); - - // Return a simple string that Claude can directly use in conversation - const summary = execution?.summary || 'Workflow completed but no summary returned.'; - return `Workflow (session ${sessionId.split('_').pop()}) completed:\n\n${summary}`; - }, -}); diff --git a/tests/evals/scenarios/delegate-mini.ts b/tests/evals/scenarios/delegate-mini.ts deleted file mode 100644 index 3391cc2..0000000 --- a/tests/evals/scenarios/delegate-mini.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Scenario } from '../types'; - -export const scenario: Scenario = { - id: 'delegate-mini', - name: 'Delegate to Mini RAH', - description: 'Ask the system to delegate a short task to mini helper.', - tools: ['delegateToMiniRAH'], - input: { - message: 'Delegate to mini RAH: summarize my notes on plaintext productivity in 3 bullets.', - mode: 'hard', - }, - expect: { - toolsCalledSoft: ['delegateToMiniRAH'], - }, -}; diff --git a/tests/evals/scenarios/delegate-wise.ts b/tests/evals/scenarios/delegate-wise.ts deleted file mode 100644 index 90aa6ac..0000000 --- a/tests/evals/scenarios/delegate-wise.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Scenario } from '../types'; - -export const scenario: Scenario = { - id: 'delegate-wise', - name: 'Delegate to Wise RAH', - description: 'Ask the system to delegate a research comparison task.', - tools: ['delegateToWiseRAH'], - input: { - message: 'Delegate to wise RAH: compare SQLite vs markdown storage for PKM in 5 bullets.', - mode: 'hard', - }, - expect: { - toolsCalledSoft: ['delegateToWiseRAH'], - }, -}; diff --git a/tests/evals/scenarios/index.ts b/tests/evals/scenarios/index.ts index bd2e80a..0c317a0 100644 --- a/tests/evals/scenarios/index.ts +++ b/tests/evals/scenarios/index.ts @@ -8,8 +8,6 @@ import { scenario as createEdge } from './create-edge'; import { scenario as queryDimensions } from './query-dimensions'; import { scenario as getDimension } from './get-dimension'; import { scenario as dimensionLifecycle } from './dimension-lifecycle'; -import { scenario as delegateMini } from './delegate-mini'; -import { scenario as delegateWise } from './delegate-wise'; import { scenario as youtubeExtract } from './youtube-extract'; import { scenario as websiteExtract } from './website-extract'; import { scenario as paperExtract } from './paper-extract'; @@ -25,8 +23,6 @@ export const scenarios = [ dimensionLifecycle, hardModeQuery, workflowIntegrate, - delegateMini, - delegateWise, youtubeExtract, websiteExtract, paperExtract,