- 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>
Implements three-tier garbage collection for agent sessions:
- SessionGCService.collect() for immediate per-session cleanup on destroySession()
- SessionGCService.sweepOrphans() for daily cron sweep of orphaned Valkey keys
- SessionGCService.fullCollect() for cold-start aggressive cleanup via OnModuleInit
- /gc slash command wired into CommandExecutorService + registered in CommandRegistryService
- SESSION_GC_CRON (daily 4am) added to CronService
- GCModule provides Valkey (ioredis via @mosaic/queue) and is imported by AgentModule, LogModule, CommandsModule, AppModule
- 8 Vitest unit tests covering all three GC tiers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add @Inject() to all gateway constructor params (required without emitDecoratorMetadata)
- AgentService: ProviderService, CoordService
- RoutingService: ProviderService
- ProvidersController: ProviderService, RoutingService
- SessionsController: AgentService
- Fix coord controller ALLOWED_ROOTS to walk up to monorepo root (pnpm-workspace.yaml)
- Gateway now boots and serves all routes correctly
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>