Files
hermes-ui/tests/server/group-chat-agent-model-config.test.ts
T
toor 1e9ea89d86
Build / build (push) Canceled after 0s
NPM Lockfile Check / npm ci --ignore-scripts (push) Canceled after 0s
Playwright / e2e (push) Canceled after 0s
chore: bootstrap hermes-ui skeleton from 0.6.29 snapshot
Import the client, server, skills, tests, and build scripts as the starting
point for the rebuild, then trim the surfaces this project does not ship:
Electron desktop packaging, the marketing website, and the ESP32 firmware
tree. CI keeps the web build, e2e, lockfile, release, and Docker workflows.

Rename the package and CLI entry points to hermes-ui, drop the prepare hook so
npm ci no longer triggers a build, and drop the removed tsconfig and nodemon
references. Rewrite AGENTS.md, ARCHITECTURE.md, DEVELOPMENT.md, and the READMEs
so the documented package map and hard rules match this repository.

reference_code/ is ignored: it is a read-only snapshot, not an input to the build.
2026-10-16 10:34:35 +08:00

43 lines
1.8 KiB
TypeScript

import { beforeEach, describe, expect, it, vi } from 'vitest'
const readConfigYamlForProfileMock = vi.fn()
vi.mock('../../packages/server/src/services/config-helpers', () => ({
readConfigYamlForProfile: readConfigYamlForProfileMock,
}))
describe('group chat agent model config', () => {
beforeEach(() => {
readConfigYamlForProfileMock.mockReset()
})
it('resolves the mentioned agent profile default model and provider', async () => {
readConfigYamlForProfileMock.mockResolvedValueOnce({
model: { default: 'research-model', provider: 'research-provider' },
})
const { resolveGroupAgentModelContext } = await import('../../packages/server/src/services/hermes/group-chat/agent-clients')
const result = await resolveGroupAgentModelContext('research')
expect(readConfigYamlForProfileMock).toHaveBeenCalledWith('research')
expect(result).toEqual({ model: 'research-model', provider: 'research-provider' })
})
it('requires cached context metadata to match the active model and provider', async () => {
const { isGroupBridgeContextCacheCompatible } = await import('../../packages/server/src/services/hermes/group-chat/agent-clients')
expect(isGroupBridgeContextCacheCompatible(
{ model: 'research-model', provider: 'research-provider' },
{ model: 'research-model', provider: 'research-provider' },
)).toBe(true)
expect(isGroupBridgeContextCacheCompatible(
{ model: 'other-model', provider: 'research-provider' },
{ model: 'research-model', provider: 'research-provider' },
)).toBe(false)
expect(isGroupBridgeContextCacheCompatible(
{ fixedContextTokens: 120 } as { model?: string; provider?: string },
{ model: 'research-model', provider: 'research-provider' },
)).toBe(false)
})
})