feat: add structured room role metadata

This commit is contained in:
Eyejoker
2026-03-28 19:30:32 +09:00
parent 806e5e4ff1
commit 79a8a2639e
13 changed files with 300 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ import { createServiceHandoff, getAllTasks } from './db.js';
import { GroupQueue } from './group-queue.js';
import { logger } from './logger.js';
import { buildRoomMemoryBriefing } from './memento-client.js';
import { buildRoomRoleContext } from './room-role-context.js';
import {
classifyRotationTrigger,
type AgentTriggerReason,
@@ -121,6 +122,10 @@ export async function runAgentForGroup(
const currentLease = getEffectiveChannelLease(chatJid);
const reviewerMode =
currentLease.reviewer_service_id === SERVICE_SESSION_SCOPE;
const roomRoleContext = buildRoomRoleContext(
currentLease,
SERVICE_SESSION_SCOPE,
);
const effectivePrompt = buildStructuredOutputPrompt(prompt, {
reviewerMode,
});
@@ -180,6 +185,7 @@ export async function runAgentForGroup(
runId,
isMain,
assistantName: deps.assistantName,
roomRoleContext,
};
const runAttempt = async (