Scope files jobs and plugins to request profile

This commit is contained in:
ekko
2026-05-24 09:25:52 +08:00
committed by ekko
parent 289a958684
commit 9708a6a521
23 changed files with 353 additions and 117 deletions
+17
View File
@@ -17,6 +17,7 @@ import {
scheduleToEditableInput,
updateJob,
} from '../../packages/client/src/api/hermes/jobs'
import { listCronRuns } from '../../packages/client/src/api/hermes/cron-history'
import type { Job } from '../../packages/client/src/api/hermes/jobs'
function makeJob(overrides: Partial<Job> = {}): Job {
@@ -118,4 +119,20 @@ describe('Hermes jobs edit payloads', () => {
schedule: 'every 14400m',
})
})
it('sends active profile header when loading job run history', async () => {
localStorage.setItem('hermes_active_profile_name', 'research')
mockFetch.mockResolvedValue({
ok: true,
status: 200,
json: () => Promise.resolve({ runs: [] }),
})
await listCronRuns('job-1')
expect(mockFetch).toHaveBeenCalledOnce()
const [url, options] = mockFetch.mock.calls[0]
expect(url).toBe('/api/cron-history?jobId=job-1')
expect(options.headers['X-Hermes-Profile']).toBe('research')
})
})