A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Keep a failed scope re-resolve from undoing a saved Bot
Fei2411d6c78a9cac2f
diff --git a/ds-bot/src/host/groups.js b/ds-bot/src/host/groups.jsindex 9bb922e2..01785bb4 100644--- a/ds-bot/src/host/groups.js+++ b/ds-bot/src/host/groups.js@@ -225,6 +225,7 @@ export function install(rt) {await rt.save()// The Session was resolved before the group owned it, so its scoped tools land now.await rt.resolveAgent(id)+ .catch(error => rt.warn('ds-bot: scoped tools for %s in %s not applied: %s', member.name, room.name, error))await rt.ensureCapabilities(id)return { id, brief: await rt.ownChatBrief(member) }}diff --git a/ds-bot/src/host/roster.js b/ds-bot/src/host/roster.jsindex 3bf5c281..ecd5be6e 100644--- a/ds-bot/src/host/roster.js+++ b/ds-bot/src/host/roster.js@@ -185,15 +185,18 @@ export function install(rt) {const opener = `${kickoff}\nWhere your instructions say otherwise, follow them.`const text = !main && language ? `${opener}\nWrite in ${language}.` : openerconst bot = state.bots[id]+ // The Bot is saved by now; a failure here must not archive it in the catch below.+ const scopeTools = () => rt.resolveAgent(id)+ .catch(error => rt.warn('ds-bot: scoped tools for %s not applied: %s', cleanName, error))if (modelRef === undefined) {bot.kickoff = { text, from: createdBy ?? null, ...(main ? { main: true } : {}) }await rt.save()// The Session was resolved before the Bot existed, so its scoped tools land now.- await rt.resolveAgent(id)+ await scopeTools()return bot}await rt.save()- await rt.resolveAgent(id)+ await scopeTools()// The greeting runs on the Bot's own model, once its provider is registered.void rt.waitForModel(bot).then(() => rt.applyModel(bot).catch(error => rt.warn('ds-bot: model for %s not applied: %s', cleanName, error)))