feat: auto-route research-prefixed prompts to research agent
This commit is contained in:
@@ -72,6 +72,19 @@ function tierFromUseCase(config: Config, useCaseRaw: unknown): ModelTier | undef
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function parseResearchPrefix(text: string): string | undefined {
|
||||
const trimmed = text.trim();
|
||||
const researchMatch = trimmed.match(/^research(?:\s*[:,-])?\s+(.+)$/i);
|
||||
if (researchMatch?.[1]) {
|
||||
return researchMatch[1].trim();
|
||||
}
|
||||
const lookupMatch = trimmed.match(/^(?:look\s+up|lookup)(?:\s*[:,-])?\s+(.+)$/i);
|
||||
if (lookupMatch?.[1]) {
|
||||
return lookupMatch[1].trim();
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the unified message handler for the channel registry.
|
||||
* Each channel+sender pair gets its own AgentOrchestrator backed by a persistent session.
|
||||
@@ -362,6 +375,13 @@ export function createMessageRouter(deps: {
|
||||
|
||||
let intentAgentOverride: string | undefined;
|
||||
let intentSkillOverride: string | undefined;
|
||||
if (!deps.config.intents?.enabled && deps.agentConfigRegistry?.get('research')) {
|
||||
const researchTask = parseResearchPrefix(incomingText);
|
||||
if (researchTask) {
|
||||
intentAgentOverride = 'research';
|
||||
incomingText = researchTask;
|
||||
}
|
||||
}
|
||||
if (deps.config.intents?.enabled && deps.intentRegistry) {
|
||||
const intentMatch = deps.intentRegistry.match(incomingText);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user