feat: auto-recreate reviewer containers on token rotation

When OAuth tokens rotate or refresh, all reviewer containers are
automatically removed. The next reviewer turn recreates them with
the latest token, preventing 401 auth failures.

Uses callback pattern to avoid circular dependencies:
- token-rotation.ts: onTokenRotated(cb)
- token-refresh.ts: onTokenRefreshed(cb)
- index.ts: registers recreateAllReviewerContainers as callback
This commit is contained in:
Eyejoker
2026-03-30 21:51:45 +09:00
parent 0e528bf471
commit 58ed721d6e
5 changed files with 104 additions and 2 deletions

View File

@@ -442,8 +442,7 @@ export function createMessageRuntime(deps: MessageRuntimeDeps): {
if (isReviewerHandoff) {
const revChName =
REVIEWER_AGENT_TYPE === 'claude-code' ? 'discord' : 'discord-review';
handoffChannel =
findChannelByName(deps.channels, revChName) || channel;
handoffChannel = findChannelByName(deps.channels, revChName) || channel;
}
const runId = `handoff-${handoff.id}`;