fix: skip discord-codex channel registration on codex service
The codex service uses its own DISCORD_BOT_TOKEN via systemd EnvironmentFile, so the discord-codex secondary channel is only relevant for the primary service. Removes spurious credential missing warning on codex service startup.
This commit is contained in:
@@ -677,12 +677,16 @@ registerChannel('discord', (opts: ChannelOpts) => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
registerChannel('discord-codex', (opts: ChannelOpts) => {
|
// Only register the secondary Codex bot channel when running as the primary (claude-code) service.
|
||||||
const envVars = readEnvFile(['DISCORD_CODEX_BOT_TOKEN']);
|
// The codex service uses its own DISCORD_BOT_TOKEN via systemd EnvironmentFile override.
|
||||||
const token =
|
if ((process.env.ASSISTANT_NAME || 'claude') !== 'codex') {
|
||||||
process.env.DISCORD_CODEX_BOT_TOKEN ||
|
registerChannel('discord-codex', (opts: ChannelOpts) => {
|
||||||
envVars.DISCORD_CODEX_BOT_TOKEN ||
|
const envVars = readEnvFile(['DISCORD_CODEX_BOT_TOKEN']);
|
||||||
'';
|
const token =
|
||||||
if (!token) return null; // Codex Discord bot is optional
|
process.env.DISCORD_CODEX_BOT_TOKEN ||
|
||||||
return new DiscordChannel(token, opts, 'codex');
|
envVars.DISCORD_CODEX_BOT_TOKEN ||
|
||||||
});
|
'';
|
||||||
|
if (!token) return null; // Codex Discord bot is optional
|
||||||
|
return new DiscordChannel(token, opts, 'codex');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user