fix: job edit schedule format error and refactor services directory

- Fix #25: job update sends schedule as plain string but upstream expects
  { kind, expr, display } object, causing "'str' object has no attribute 'get'"
- Move hermes-cli.ts, hermes.ts, hermes-profile.ts into services/hermes/
  for multi-agent namespacing consistency
- Fix ts-node Set spread compatibility in filesystem.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-17 16:48:24 +08:00
parent 9a0b50f370
commit 3d2b1c5e47
15 changed files with 40 additions and 19 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest'
// Mock hermes-cli
vi.mock('../../packages/server/src/services/hermes-cli', () => ({
vi.mock('../../packages/server/src/services/hermes/hermes-cli', () => ({
listProfiles: vi.fn(),
getProfile: vi.fn(),
createProfile: vi.fn(),
@@ -16,7 +16,7 @@ vi.mock('../../packages/server/src/services/hermes-cli', () => ({
importProfile: vi.fn(),
}))
import * as hermesCli from '../../packages/server/src/services/hermes-cli'
import * as hermesCli from '../../packages/server/src/services/hermes/hermes-cli'
describe('Profile Routes', () => {
beforeEach(() => {
+9 -1
View File
@@ -120,7 +120,15 @@ describe('Proxy Handler', () => {
})
it('returns 502 on connection failure', async () => {
mockFetch.mockRejectedValue(new Error('ECONNREFUSED'))
// waitForGatewayReady loops calling fetch(healthUrl) until res.ok or timeout.
// Return ok:true for health checks so the loop exits immediately (gateway
// "ready"), then the retry fetch also fails with ECONNREFUSED → 502.
mockFetch.mockImplementation((url: string) => {
if (typeof url === 'string' && url.includes('/health')) {
return Promise.resolve({ ok: true })
}
return Promise.reject(new Error('ECONNREFUSED'))
})
const ctx = createMockCtx()
await proxy(ctx)