From f9b1e748389255b5e8e143ce8f4de32326f427a6 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 19 Jun 2026 00:00:20 +0900 Subject: [PATCH] fix(rooms): default new rooms to tribunal when room_mode is omitted assign_room (MCP tool + host-side assignRoomInDatabase) and setup register previously fell back to 'single' when no room_mode was given, so newly added rooms silently lost the reviewer. Default to 'tribunal' across the MCP zod schema, the IPC arg fallback, and the DB helper, and update the ipc-auth expectation accordingly. Co-Authored-By: Claude Opus 4.7 --- runners/agent-runner/src/ipc-mcp-stdio.ts | 8 +++++--- src/db/rooms.ts | 2 +- src/ipc-auth.test.ts | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/runners/agent-runner/src/ipc-mcp-stdio.ts b/runners/agent-runner/src/ipc-mcp-stdio.ts index 3b3e1f1..0563901 100644 --- a/runners/agent-runner/src/ipc-mcp-stdio.ts +++ b/runners/agent-runner/src/ipc-mcp-stdio.ts @@ -765,8 +765,10 @@ If folder is omitted, the host generates one automatically.`, name: z.string().describe('Display name for the room'), room_mode: z .enum(['single', 'tribunal']) - .default('single') - .describe('single=owner only, tribunal=owner/reviewer roles enabled'), + .default('tribunal') + .describe( + 'single=owner only, tribunal=owner/reviewer roles enabled (default)', + ), owner_agent_type: z .enum(['claude-code', 'codex']) .optional() @@ -831,7 +833,7 @@ If folder is omitted, the host generates one automatically.`, type: 'assign_room', jid: args.jid, name: args.name, - room_mode: args.room_mode || 'single', + room_mode: args.room_mode || 'tribunal', owner_agent_type: args.owner_agent_type, reviewer_agent_type: args.reviewer_agent_type, arbiter_agent_type: args.arbiter_agent_type, diff --git a/src/db/rooms.ts b/src/db/rooms.ts index 9cb75e3..189345b 100644 --- a/src/db/rooms.ts +++ b/src/db/rooms.ts @@ -194,7 +194,7 @@ export function assignRoomInDatabase( input: AssignRoomInput, ): (RegisteredGroup & { jid: string }) | undefined { const existing = getStoredRoomSettingsRowFromDatabase(database, chatJid); - const roomMode = input.roomMode || existing?.roomMode || 'single'; + const roomMode = input.roomMode || existing?.roomMode || 'tribunal'; const ownerAgentType = input.ownerAgentType || existing?.ownerAgentType || OWNER_AGENT_TYPE; const folder = resolveAssignedRoomFolder( diff --git a/src/ipc-auth.test.ts b/src/ipc-auth.test.ts index 981d49e..060e720 100644 --- a/src/ipc-auth.test.ts +++ b/src/ipc-auth.test.ts @@ -1131,7 +1131,7 @@ describe('assign_room success', () => { }); }); - it('assign_room auto-fills missing folder for single rooms without exposing trigger metadata', async () => { + it('assign_room auto-fills missing folder and defaults to tribunal without exposing trigger metadata', async () => { await processTaskIpc( { type: 'assign_room', @@ -1146,7 +1146,7 @@ describe('assign_room success', () => { const group = getRegisteredGroup('partial@g.us'); expect(group).toBeDefined(); expect(group!.folder).toMatch(/^grp_whatsapp_/); - expect(getStoredRoomSettings('partial@g.us')?.roomMode).toBe('single'); + expect(getStoredRoomSettings('partial@g.us')?.roomMode).toBe('tribunal'); }); it('assign_room preserves an existing tribunal room mode when room_mode is omitted', async () => {