feat: unify 3 bot services into single process

- Add UNIFIED_MODE flag (default on, disable with UNIFIED_MODE=0)
- Register all 3 Discord bots in one process (claude, codex, review)
- Load all registered groups regardless of agent_type (codex/owner priority)
- Start credential proxy and container cleanup at unified startup
- shouldServiceProcessChat returns true in unified mode
- Add findChannelByName for role-based response routing
- Backward compatible: UNIFIED_MODE=0 restores per-service behavior
This commit is contained in:
Eyejoker
2026-03-29 18:22:57 +09:00
parent fc9f2867b9
commit d01f98bd61
20 changed files with 118 additions and 759 deletions

View File

@@ -22,6 +22,9 @@ export const SERVICE_AGENT_TYPE: AgentType =
? 'codex'
: 'claude-code';
/** Unified mode: single process manages all bots. Disable with UNIFIED_MODE=0. */
export const UNIFIED_MODE = getEnv('UNIFIED_MODE') !== '0';
export function normalizeServiceId(serviceId: string): string {
if (serviceId === 'codex') {
return CODEX_MAIN_SERVICE_ID;