Skip to content

The agent that grows with you

fix(hermes-bots): composeSoul honors the bot_mode_protocol capability

Teknium400400e1d9de
diff --git a/apps/desktop/src/plugins/hermes-bots/plugin.js b/apps/desktop/src/plugins/hermes-bots/plugin.js
index 1cae031119c..851db6f872f 100644
--- a/apps/desktop/src/plugins/hermes-bots/plugin.js
+++ b/apps/desktop/src/plugins/hermes-bots/plugin.js
@@ -2838,7 +2838,8 @@ function backfillMessagingProtocol(roster) {
}
/** SOUL.md for a new bot: identity (or the user's custom SOUL) + the
- * messaging protocol, which ALWAYS ships. */
+ * messaging protocol — which ships UNLESS the backend injects it into the
+ * system prompt itself (bot_mode_protocol capability). */
function composeSoul({ name, title, description, roster, customSoul }) {
if (customSoul && customSoul.trim()) {
return ensureMessagingProtocol(customSoul, name, roster)
@@ -2854,7 +2855,9 @@ function composeSoul({ name, title, description, roster, customSoul }) {
'You keep your own memory, skills, and conversation history across sessions.'
]
- return lines.filter(line => line !== null).join('\n') + '\n\n' + messagingProtocolSection(name, roster)
+ const identity = lines.filter(line => line !== null).join('\n')
+
+ return serverInjectsProtocol ? identity : identity + '\n\n' + messagingProtocolSection(name, roster)
}
// ── human-readable row helpers ───────────────────────────────────────────────
diff --git a/apps/desktop/src/plugins/hermes-bots/tests/soul-protocol-backfill.test.mjs b/apps/desktop/src/plugins/hermes-bots/tests/soul-protocol-backfill.test.mjs
index 24a3694ad0b..a405e9f0878 100644
--- a/apps/desktop/src/plugins/hermes-bots/tests/soul-protocol-backfill.test.mjs
+++ b/apps/desktop/src/plugins/hermes-bots/tests/soul-protocol-backfill.test.mjs
@@ -138,4 +138,8 @@ test('backend bot_mode_protocol capability suppresses every SOUL protocol write'
)
await new Promise(resolve => setTimeout(resolve, 0))
assert.equal(calls.length, 0)
+
+ // composeSoul's generated-identity path also skips the section.
+ const generated = helpers.composeSoul({ name: 'newbot', title: 'T', description: 'D', roster: [], customSoul: '' })
+ assert.doesNotMatch(generated, /## Messaging other agents/)
})