forked from mosaicstack/stack
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) <[email protected]>
12 lines
424 B
TypeScript
12 lines
424 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { CommandRegistryService } from './command-registry.service.js';
|
|
import { CommandExecutorService } from './command-executor.service.js';
|
|
import { GCModule } from '../gc/gc.module.js';
|
|
|
|
@Module({
|
|
imports: [GCModule],
|
|
providers: [CommandRegistryService, CommandExecutorService],
|
|
exports: [CommandRegistryService, CommandExecutorService],
|
|
})
|
|
export class CommandsModule {}
|