feat: add 'both' agent type for shared Claude Code + Codex channels

- AgentType now supports 'both' — runs both agents sequentially
- Each agent gets its own folder suffix (_cc / _codex) for isolated sessions
- Claude Code bot handles message storage for 'both' channels
- Responses routed through the matching bot for each agent type
This commit is contained in:
Eyejoker
2026-03-10 23:58:13 +09:00
parent f02761eddb
commit 955a2901c8
3 changed files with 76 additions and 33 deletions

View File

@@ -249,7 +249,11 @@ export class DiscordChannel implements Channel {
if (!this.agentTypeFilter) return true;
const group = this.opts.registeredGroups()[jid];
if (!group) return false;
return (group.agentType || 'claude-code') === this.agentTypeFilter;
const groupType = group.agentType || 'claude-code';
// 'both' channels are owned by the claude-code bot (primary handler for
// message storage and typing). The codex bot skips them to avoid duplicates.
if (groupType === 'both') return this.agentTypeFilter === 'claude-code';
return groupType === this.agentTypeFilter;
}
async disconnect(): Promise<void> {