Files
hermes-ui/tests/client/chat-panel-session-click.test.ts
T
toor 8c1ddf415f Phase 003: remove the coding-agent and ekko-agent runtimes
Every chat session now runs through the Hermes bridge, so the three chat
chains become feature-equivalent instead of three partially-maintained
dispatch paths. Keeping the coding-agent and in-house agent runtimes alive
meant every bridge change had to be mirrored into two more runtimes that
had already drifted.

Historical rows are read, not migrated: sessions stored with the retired
source normalize to cli on load, workflow graphs naming the retired agents
keep loading and run on the bridge, and the visible-source check plus
SOURCE_LABELS still recognize the old value so those sessions stay listed.

The public surface follows the code: the OpenAPI generator and the MCP
chat-run tool schema drop the six retired entry fields so external callers
are not told about runtimes that no longer exist.

harness-check gains a RETIRED_RUNTIME scan so the residual check is a
mechanical gate instead of a manual grep, with the two surviving read-side
compat sites recorded with reasons.

Refs: docs/phases/phase_003.md
2026-10-16 13:27:50 +08:00

44 lines
2.1 KiB
TypeScript

import { readFileSync } from 'fs'
import { describe, expect, it } from 'vitest'
describe('ChatPanel session clicks', () => {
it('switches the store when the route is already on the clicked session', () => {
const source = readFileSync('packages/client/src/components/hermes/chat/ChatPanel.vue', 'utf8')
expect(source).toContain('if (chatStore.activeSessionId !== sessionId)')
expect(source).toContain('await chatStore.switchSession(sessionId)')
})
it('switches the session model without a protocol mode modal', () => {
const source = readFileSync('packages/client/src/components/hermes/chat/ChatPanel.vue', 'utf8')
expect(source).toContain('chatStore.switchSessionModel(model, provider, sessionModelSessionId.value)')
expect(source).not.toContain('showSessionModelModeModal')
expect(source).not.toContain('pendingSessionModelSwitch')
expect(source).not.toContain('header-model-button--readonly')
})
it('does not gate session model switching on a coding agent id', () => {
const source = readFileSync('packages/client/src/components/hermes/chat/ChatPanel.vue', 'utf8')
expect(source).not.toContain('sessionModelCodingAgentId')
expect(source).not.toContain('isSessionModelScopedCodingAgent')
})
it('uses the active sidebar model as the new chat default for the active profile', () => {
const source = readFileSync('packages/client/src/components/hermes/chat/ChatPanel.vue', 'utf8')
expect(source).toContain('const selectedProvider = appStore.selectedProvider || ""')
expect(source).toContain('const selectedModel = appStore.selectedModel || ""')
expect(source).toContain('profile === activeProfileName')
expect(source).toContain('selectedGroup?.models.includes(selectedModel)')
})
it('uses a create action in the new chat drawer instead of duplicating the new chat trigger label', () => {
const source = readFileSync('packages/client/src/components/hermes/chat/ChatPanel.vue', 'utf8')
expect(source).toContain('{{ t("common.create") }}')
expect(source).not.toContain('{{ t("chat.newChat") }}\n </NButton>')
})
})