backend: Update captions agent name and improve environment checks in TokenService

This commit is contained in:
CSantosM 2026-01-28 16:25:43 +01:00
parent 43f7ff5001
commit 4ac182c244
2 changed files with 12 additions and 7 deletions

View File

@ -49,7 +49,7 @@ export const INTERNAL_CONFIG = {
PARTICIPANT_MAX_CONCURRENT_NAME_REQUESTS: '20', // Maximum number of request by the same name at the same time allowed
PARTICIPANT_NAME_RESERVATION_TTL: '12h' as StringValue, // Time-to-live for participant name reservations
CAPTIONS_AGENT_NAME: 'agent-meet-captions',
CAPTIONS_AGENT_NAME: 'agent-speech-processing',
// MongoDB Schema Versions
// These define the current schema version for each collection

View File

@ -71,17 +71,22 @@ export class TokenService {
at.addGrant(grants);
}
const captionsEnabledInEnv = MEET_ENV.CAPTIONS_ENABLED === 'true';
const captionsEnabledGlobally = MEET_ENV.CAPTIONS_ENABLED === 'true';
const captionsEnabledInRoom = Boolean(roomWithCaptions);
// Warn if configuration is inconsistent
if (!captionsEnabledInEnv && captionsEnabledInRoom) {
if (!captionsEnabledGlobally) {
if (captionsEnabledInRoom) {
this.logger.warn(
`Captions feature is disabled in environment but Room is created with captions enabled. Please enable captions in environment by setting MEET_CAPTIONS_ENABLED=true to ensure proper functionality.`
`Captions feature is disabled in environment but Room is created with captions enabled. ` +
`Please enable captions in environment by setting MEET_CAPTIONS_ENABLED=true to ensure proper functionality.`
);
}
if (captionsEnabledInEnv && captionsEnabledInRoom) {
return await at.toJwt();
}
if (captionsEnabledInRoom) {
this.logger.debug('Activating Captions Agent. Configuring Room Agent Dispatch.');
at.roomConfig = new RoomConfiguration({
agents: [