Skip to content

The agent that grows with you

fix(desktop): read bot-mode state through the plugin SDK

brooklyn!7bde1dfe201a
diff --git a/apps/desktop/src/plugins/hermes-bots/relay.test.ts b/apps/desktop/src/plugins/hermes-bots/relay.test.ts
index 99064c450ae..dd66dbd4f8f 100644
--- a/apps/desktop/src/plugins/hermes-bots/relay.test.ts
+++ b/apps/desktop/src/plugins/hermes-bots/relay.test.ts
@@ -30,6 +30,16 @@ const { clearBotAttentionMock, hostMock, noteBotAttentionMock, UnboundedCache }
clearBotAttentionMock: vi.fn(),
hostMock: {
onEvent: vi.fn(),
+ pluginDecisions: {
+ get: () => {
+ try {
+ const raw = window.localStorage.getItem('hermes.desktop.pluginDecisions.v2')
+ return raw ? (JSON.parse(raw) as Record<string, boolean>) : {}
+ } catch {
+ return {}
+ }
+ }
+ },
profileRoutes: vi.fn(),
requestProfile: vi.fn(),
retainProfileSocket: vi.fn()
diff --git a/apps/desktop/src/plugins/hermes-bots/relay.ts b/apps/desktop/src/plugins/hermes-bots/relay.ts
index ba3a0e6b805..727b94a3f15 100644
--- a/apps/desktop/src/plugins/hermes-bots/relay.ts
+++ b/apps/desktop/src/plugins/hermes-bots/relay.ts
@@ -9,8 +9,6 @@
import { host, LruCache } from '@hermes/plugin-sdk'
-import { pluginActive } from '@/contrib/plugins-store'
-
import { botHandle, clearBotAttention, noteBotAttention } from './data'
import { ID } from './shared'
import type { ProfileRoute, RosterRow } from './types'
@@ -120,7 +118,9 @@ const RELAY_OUTBOX_ANY = '*'
const routesWithOutboxWork = new Set<string>()
function relayBotModeOn(): boolean {
- return pluginActive(ID)
+ const decisions = host.pluginDecisions.get()
+
+ return ID in decisions ? Boolean(decisions[ID]) : true
}
function noteRelayOutboxWork(event?: { connectionId?: string }) {