feat(routing): add auto_escalate retry to complex tier
This commit is contained in:
+14
-1
@@ -888,7 +888,20 @@ export function createMessageRouter(deps: {
|
||||
}
|
||||
}
|
||||
|
||||
const response = await agent.process(messageText, attachments);
|
||||
let response: string;
|
||||
try {
|
||||
response = await agent.process(messageText, attachments);
|
||||
} catch (error) {
|
||||
const currentTier = agent.getModelTier();
|
||||
const canEscalate = deps.config.agents.auto_escalate && currentTier !== 'complex';
|
||||
if (!canEscalate) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
console.warn(`Auto-escalating session ${msg.channel}:${msg.senderId} from ${currentTier} to complex after processing failure.`);
|
||||
agent.setModelTier('complex');
|
||||
response = await agent.process(messageText, attachments);
|
||||
}
|
||||
const outboundAttachments = collector.drain();
|
||||
await reply({
|
||||
text: response,
|
||||
|
||||
Reference in New Issue
Block a user