Add cost-aware routing and LLM budget tracking
- BudgetTracker tracks LLM token cost separately from tool cost - LlmClient auto-records cost into request-scoped budget - Router selects tier from classify confidence, intent risk, escalation count - Supervisor short-circuits via regex fast-path when rule confidence is high - Onboarding skill loads user escalation history to inform routing
This commit is contained in:
1 parent
211de18476
commit
21df14cd00
16 files changed
+473
-22
No files matched your search
@@ -3,12 +3,12 @@ import { AsyncLocalStorage } from 'node:async_hooks';
|
||||
import type { Logger } from 'pino';
|
||||
|
||||
import { getLogger } from './logger.js';
|
||||
import type { BudgetSnapshot } from '@agent/budget';
|
||||
import type { BudgetTracker } from '@agent/budget';
|
||||
|
||||
export interface RequestContext {
|
||||
chatroomId: string;
|
||||
deadlineAt?: string;
|
||||
budget?: BudgetSnapshot | undefined;
|
||||
budget?: BudgetTracker | undefined;
|
||||
handoffChain?: string[] | undefined;
|
||||
handoffDepth?: number | undefined;
|
||||
logger: Logger;
|
||||
|
||||
Reference in new issue
Block a user