Overview: report liveness and a Source whose poll loop stopped

This commit is contained in:
2026-11-02 01:22:34 +08:00
parent a662188a57
commit b348d69beb
10 changed files with 153 additions and 13 deletions
+2 -1
View File
@@ -42,7 +42,8 @@ const openMaster = async (container: HTMLElement) => {
}
const serve = () => vi.stubGlobal('fetch', vi.fn(async (url: string) => {
const path = new URL(url, 'http://127.0.0.1').pathname.replace('/orchestrator/api/', '')
if (path === 'overview') return Response.json({ problems: [], person: [], executor: { running: 0, queued: 0, maxWorkers: 3, idle: 0 }, flow: { triggers: 0, filtered: 0, judged: 0, accepted: 0, evaluating: 0 }, policyVersion: 'v' })
if (path === 'overview') return Response.json({ problems: [], liveness: { startedAt: null, uptimeMs: null, lastPollAt: null, pollAgeMs: null, polling: false }, person: [],
executor: { running: 0, queued: 0, maxWorkers: 3, idle: 0 }, flow: { triggers: 0, filtered: 0, judged: 0, accepted: 0, evaluating: 0 }, policyVersion: 'v' })
if (path === 'state') return Response.json({ masterId: 'master', settings: SettingsSchema.parse({}), revisions: { policy: 0, eval: 0, executor: 0 }, sources: [], policy_version: 'v', health: {}, outgoing: [], load: { running: 0, queued: 0 },
setup: { machine: { stateDir: '/srv/state', worktreeRoot: '/srv/state/worktrees', blockedCommands: [], promptMaxChars: 100000, admissionContextMaxPages: 10, admissionContextTimeoutMs: 15000 }, problem: null, feishuProblem: null, accounts: null } })
return Response.json({ error: 'unavailable' }, { status: 503 })