mirror of
https://github.com/EKKOLearnAI/hermes-web-ui.git
synced 2026-06-03 09:50:16 +00:00
add web ui openrouter attribution (#1057)
This commit is contained in:
@@ -93,6 +93,28 @@ describe('agent bridge manager command resolution', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('injects Web UI OpenRouter attribution into the bridge process env by default', async () => {
|
||||
const { buildAgentBridgeProcessEnv } = await import('../../packages/server/src/services/hermes/agent-bridge/manager')
|
||||
const env = buildAgentBridgeProcessEnv('ipc:///tmp/test.sock', '/tmp/hermes-home', '/tmp/hermes-agent')
|
||||
|
||||
expect(env.HERMES_OPENROUTER_APP_REFERER).toBe('https://ekkolearnai.com')
|
||||
expect(env.HERMES_OPENROUTER_APP_TITLE).toBe('Hermes Web UI')
|
||||
expect(env.HERMES_OPENROUTER_APP_CATEGORIES).toBe('cli-agent,personal-agent')
|
||||
})
|
||||
|
||||
it('keeps explicit OpenRouter attribution env values when starting the bridge', async () => {
|
||||
process.env.HERMES_OPENROUTER_APP_REFERER = 'https://example.invalid/app'
|
||||
process.env.HERMES_OPENROUTER_APP_TITLE = 'Custom App'
|
||||
process.env.HERMES_OPENROUTER_APP_CATEGORIES = 'custom-category'
|
||||
|
||||
const { buildAgentBridgeProcessEnv } = await import('../../packages/server/src/services/hermes/agent-bridge/manager')
|
||||
const env = buildAgentBridgeProcessEnv('ipc:///tmp/test.sock', '/tmp/hermes-home', undefined)
|
||||
|
||||
expect(env.HERMES_OPENROUTER_APP_REFERER).toBe('https://example.invalid/app')
|
||||
expect(env.HERMES_OPENROUTER_APP_TITLE).toBe('Custom App')
|
||||
expect(env.HERMES_OPENROUTER_APP_CATEGORIES).toBe('custom-category')
|
||||
})
|
||||
|
||||
it('uses an isolated default bridge endpoint while running under Vitest', async () => {
|
||||
const { DEFAULT_AGENT_BRIDGE_ENDPOINT } = await import('../../packages/server/src/services/hermes/agent-bridge/client')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user