feat: paired review system overhaul — unified service, configurable agents, silent output removal
- Remove UNIFIED_MODE legacy: single service manages all 3 Discord bots - Add OWNER_AGENT_TYPE / REVIEWER_AGENT_TYPE env vars for configurable agent selection - Fix Discord channel routing: reviewer output goes through correct bot (discord/discord-review) - Fix channel name assignment: explicit names prevent agentTypeFilter collision - Remove silent output suppression system: harness-level protections replace prompt workarounds - Add reviewer approval detection: DONE marker on first line stops ping-pong - Include user's original message in reviewer prompt for context - Fix round_trip_count auto-reset on new user message - Fix session ID conflict: reviewer doesn't reuse owner's session - Fix pending progress text flush in runner on close sentinel - Promote buffered intermediate text to final result when result event has no text - Remove legacy files: .env.codex.example, .env.codex-review.example, migrate-unify.cjs - Update CLAUDE.md: server-side build deployment, unified architecture docs
This commit is contained in:
@@ -89,6 +89,12 @@ export function hasAllowedTrigger(opts: {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Paired rooms: bot-to-bot ping-pong doesn't need trigger patterns.
|
||||
// Peer bot messages (from reviewer/owner) are always allowed.
|
||||
if (isPairedRoomJid(chatJid)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const allowlistCfg = loadSenderAllowlist();
|
||||
const hasTrigger = messages.some(
|
||||
(message) =>
|
||||
@@ -104,14 +110,10 @@ export function getProcessableMessages(
|
||||
messages: Parameters<typeof filterProcessableMessages>[0],
|
||||
channel?: Channel,
|
||||
) {
|
||||
const isPaired = isPairedRoomJid(chatJid);
|
||||
return filterProcessableMessages(
|
||||
messages,
|
||||
isPaired,
|
||||
// In paired rooms (unified mode), don't filter by isOwnMessage —
|
||||
// both bots need to see each other's messages for the ping-pong flow.
|
||||
// Loop prevention is handled by filterLoopingPairedBotMessages + round_trip_count.
|
||||
isPaired ? undefined : channel?.isOwnMessage?.bind(channel),
|
||||
isPairedRoomJid(chatJid),
|
||||
channel?.isOwnMessage?.bind(channel),
|
||||
).filter((message) => !isTaskStatusControlMessage(message.content));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user