From e83111f7d511a4d0691ffcef6d3f56142b8e70cc Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 15 Jul 2026 21:35:36 +0100 Subject: [PATCH] Separate Persona scheduling from Face provisioning --- apps/bot/src/discord-bot.ts | 14 +------------- apps/persona-scheduler/src/index.ts | 1 - scripts/run-repo-face-heartbeats.ts | 12 ------------ 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/apps/bot/src/discord-bot.ts b/apps/bot/src/discord-bot.ts index 4fdfcda..bd84fe2 100644 --- a/apps/bot/src/discord-bot.ts +++ b/apps/bot/src/discord-bot.ts @@ -15,7 +15,6 @@ import { OllamaSituationalSocialReadInferer, PermissionEngine, createStateStorage, - ensureRepoFaceInitialized, faceRegistryAsRepoDiscordRegistry, findRepoDiscordIdentityByPersonaName, findRepoDiscordIdentityByRoleIds, @@ -431,15 +430,6 @@ export async function startBot(): Promise { console.log(`Ignored empty repo Face mention ${message.id} for ${identity.id}.`); continue; } - const faceInitialization = await ensureRepoFaceInitialized({ - identity, - storageRoot: config.storageRoot, - sourceRepoRoot: config.sourceRepoRoot, - epiphanyAgentRoot: config.epiphanyAgentRoot, - workspaceRoot: process.cwd(), - birthMode: config.repoFaceBirthMode, - birthExecutor: config.repoFaceBirthExecutor, - }); const queuedMention = await queueRepoFaceMention({ statePath: config.repoFaceHeartbeats.statePath, identity, @@ -454,9 +444,7 @@ export async function startBot(): Promise { queuedCount += 1; } console.log( - `Queued repo Face mention ${message.id} for ${identity.id} via CTB turn queue (${queuedMention.pendingCount} pending). Birth status: ${ - faceInitialization.birthStatusPath ?? faceInitialization.skippedReason ?? "unknown" - }`, + `Queued repo Face mention ${message.id} for ${identity.id} via CTB turn queue (${queuedMention.pendingCount} pending).`, ); } if (queuedCount === 0) { diff --git a/apps/persona-scheduler/src/index.ts b/apps/persona-scheduler/src/index.ts index 00e53e1..7a77936 100644 --- a/apps/persona-scheduler/src/index.ts +++ b/apps/persona-scheduler/src/index.ts @@ -58,7 +58,6 @@ function scheduleNext(): void { await runTick(); scheduleNext(); }, intervalMs); - timer.unref(); } async function shutdown(signal: string): Promise { diff --git a/scripts/run-repo-face-heartbeats.ts b/scripts/run-repo-face-heartbeats.ts index 2d6aee5..fd5c4ab 100644 --- a/scripts/run-repo-face-heartbeats.ts +++ b/scripts/run-repo-face-heartbeats.ts @@ -12,7 +12,6 @@ import { buildEpiphanyIdentityRegistry, ContextBuilder, createStateStorage, - ensureRepoFaceInitialized, getRepoFaceSourceRepoName, getRepoDiscordIdentityAllowedChannelIds, faceRegistryAsRepoDiscordRegistry, @@ -554,17 +553,6 @@ async function queueRepoFaceTurn(input: { } const contextBuilder = new ContextBuilder(); - if (identity.identityKind !== "native_persona") { - await ensureRepoFaceInitialized({ - identity, - storageRoot: input.config.storageRoot, - sourceRepoRoot: input.config.sourceRepoRoot, - epiphanyAgentRoot: input.config.epiphanyAgentRoot, - workspaceRoot: process.cwd(), - birthMode: input.config.repoFaceBirthMode, - birthExecutor: input.config.repoFaceBirthExecutor, - }); - } const recentMessages = await fetchRecentDiscordMessages({ botToken: input.config.botToken, channelId,