Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix(mcp-host): recover quoted workflow intents
Alfredo Lopez6e3da7684e9c
diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex 601af23c9..4a3694e8a 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.470",+ "version": "0.1.471","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.470",+ "version": "0.1.471","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex a9d4f6471..5fb1bfddd 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.470",+ "version": "0.1.471","description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude","main": "dist/main.js","engines": {diff --git a/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.test.ts b/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.test.tsindex 47b7b6c2e..a0377358f 100644--- a/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.test.ts+++ b/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.test.ts@@ -28,4 +28,25 @@ describe('shouldRecoverWorkflowTriggerTextResponse', () => {)).toBe(true)})++ it.each([+ 'Run "quarterly-report"',+ "Run 'quarterly-report'",+ 'Run “quarterly-report”',+ 'Run ‘quarterly-report’',+ 'Please run quarterly-report',+ 'Launch quarterly-report',+ 'Run quarterly-report.',+ 'Please launch “quarterly-report”.',+ ])('recovers a direct named recipe request: %s', userText => {+ expect(shouldRecoverWorkflowTriggerTextResponse(userText, 'I can help with that.')).toBe(true)+ })++ it.each([+ 'Run a shell command',+ 'Run quarterly-report and delete it',+ `Run ${'a'.repeat(129)}-report`,+ ])('does not infer a recipe from unrelated or oversized text: %s', userText => {+ expect(shouldRecoverWorkflowTriggerTextResponse(userText, 'I can help with that.')).toBe(false)+ })})diff --git a/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.ts b/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.tsindex 5e4add6e5..7fb9964d9 100644--- a/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.ts+++ b/mcp-host/src/core/orchestration/toolUseLoopIntentRecovery.ts@@ -89,9 +89,12 @@ export function shouldRecoverWorkflowTriggerTextResponse(if (isWorkflowListIntent(userText)) return falseconst normalizedUser = userText.toLowerCase()- const directTrigger = userText.match(/^\s*(?:run|execute|trigger|start)\s+(\S{1,128})\s*$/i)+ const directTrigger = userText.match(+ /^\s*(?:please\s+)?(?:run|execute|trigger|start|launch)\s+(\S{1,128})\s*$/i+ )const directCandidate = directTrigger?.[1]- .replace(/[\u0060\u0027\u201C\u201D\u2018\u2019]/g, '')+ .replace(/[\u0060\u0022\u0027\u201C\u201D\u2018\u2019]/g, '')+ .replace(/\.$/, '').trim()const namesDirectRecipe =directCandidate !== undefined && /^[a-z0-9]+(?:-[a-z0-9]+)+$/i.test(directCandidate)