feat(M4-013,M5-001,M5-002,M5-003): routing e2e tests, agent config loading, model+agent switching
- M4-013: Add routing-e2e.test.ts with 9 integration tests covering the full classify → match rules → routing decision pipeline; includes coding→Opus, summarization→GLM-5, conversation→Sonnet, cheap-tier→Haiku, /model bypass, unhealthy-provider fallback, and research→Codex scenarios - M5-001: Store resolvedAgentName during session creation when agentConfigId is provided; expose agentName on AgentSession and SessionInfoDto; emit agentName in session:info from chat.gateway.ts (message handler and set:thinking handler); preserve userId and conversationHistory in merged options so they are not lost when agent config is applied - M5-002: Add AgentService.updateSessionModel() to update live session modelId metadata; wire it into ChatGateway.setModelOverride() so the /model command immediately reflects in session:info; add ChatGateway.broadcastSessionInfo() to push updated session:info to all clients watching a conversation on model or agent switch - M5-003: Implement /agent <name> command end-to-end: inject Brain into CommandExecutorService; replace stub handleAgent() with real brain.agents.findByName() + findById() lookup; call agentService.applyAgentConfig() to update live session; emit session:info via chatGateway.broadcastSessionInfo(); update tests to mock brain and agentService.applyAgentConfig; add AgentService.applyAgentConfig() method Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -352,6 +352,11 @@ export class AgentService implements OnModuleDestroy {
|
||||
|
||||
this.sessions.set(sessionId, session);
|
||||
this.logger.log(`Agent session ${sessionId} ready (${providerName}/${modelId})`);
|
||||
if (resolvedAgentName) {
|
||||
this.logger.log(
|
||||
`Agent session ${sessionId} using agent config "${resolvedAgentName}" (M5-001)`,
|
||||
);
|
||||
}
|
||||
|
||||
return session;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user