Improve profile runtime controls (#868)

* Improve profile runtime controls

* Restore profile selector test id

* Update profile switch e2e flow
This commit is contained in:
ekko
2026-05-20 12:59:34 +08:00
committed by GitHub
parent 479fef8a84
commit 663afb61ff
15 changed files with 864 additions and 40 deletions
+21
View File
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest'
import {
gatewayStatusLooksRuntimeLocked,
gatewayStatusLooksRunning,
parseGatewayStatusesFromProfileListOutput,
} from '../../packages/server/src/services/hermes/gateway-autostart'
describe('gateway autostart status parsing', () => {
@@ -14,4 +15,24 @@ describe('gateway autostart status parsing', () => {
it('does not treat not-running status as running', () => {
expect(gatewayStatusLooksRunning('Gateway is not running')).toBe(false)
})
it('parses gateway status from hermes profile list output', () => {
const output = `
Profile Model Gateway Alias Distribution
─────────────── ─────────────────────────── ─────────── ─────────── ────────────────────
◆default glm-5-turbo running — —
akri glm-5-turbo running akri —
tester gpt-5.5 stopped tester —
`
const statuses = parseGatewayStatusesFromProfileListOutput(output)
expect(statuses.get('default')).toBe('running')
expect(statuses.get('akri')).toBe('running')
expect(statuses.get('tester')).toBe('stopped')
})
it('uses profile-list gateway status text for running checks', () => {
expect(gatewayStatusLooksRunning('running')).toBe(true)
expect(gatewayStatusLooksRunning('stopped')).toBe(false)
expect(gatewayStatusLooksRunning('not running')).toBe(false)
})
})