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.
43 lines
1.8 KiB
TypeScript
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)
|
|
})
|
|
})
|