Executions: show runs waiting on a prompt; Automated tab filters on the server (#3, #4)
CI / Lint (eslint) (pull_request) Successful in 29s
CI / Test (jest) (pull_request) Successful in 24s
CI / Security (npm audit) (pull_request) Successful in 12s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 1m48s
CI / Integration (api) (pull_request) Successful in 2m32s
CI / UI (playwright) (pull_request) Successful in 2m6s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 2m28s

- #3: the list response includes waiting_for_input for each execution
  (a running execution blocked on a prompt). The row shows it as
  'waiting' (the design system's purple status) and the Waiting status
  filter, which could never match, now finds it.
- #4: new only_internal=true filter (Gandalf and scheduler runs), used by
  the Automated tab, so it pages and counts on the server like the Manual
  tab; the client-side filter over one shared page is gone.
- Tests: integration for waiting_for_input and both server filters; UI
  for the waiting status and the filter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-23 11:38:22 -05:00
1 parent 9a6a4c0b66
commit 39d28fb9e7
5 files changed
+58 -14

No files matched your search

+13 -1
View File
@@ -3,7 +3,7 @@
// The contract Gandalf depends on (gandalf/monitor.py PulseClient.run_command):
// POST /api/internal/command -> {execution_id}; poll GET /api/internal/executions/:id
// until status is 'completed' (stdout read from the command_result log) or 'failed'.
const { gandalf, workerByName, waitForExecution, commandResult } = require('./helpers');
const { gandalf, sso, workerByName, waitForExecution, commandResult } = require('./helpers');
let workerId;
beforeAll(async () => {
@@ -53,3 +53,15 @@ test('an unknown execution id is a 404', async () => {
const r = await gandalf('GET', '/api/internal/executions/00000000-0000-0000-0000-000000000000');
expect(r.status).toBe(404);
});
test('the Automated and Manual views filter on the server (#4)', async () => {
const submit = await gandalf('POST', '/api/internal/command', { worker_id: workerId, command: 'echo automated' });
await waitForExecution(submit.json.execution_id);
const auto = (await sso('GET', '/api/executions?only_internal=true&limit=200')).json;
const manual = (await sso('GET', '/api/executions?hide_internal=true&limit=200')).json;
const automated = by => /^(gandalf|scheduler):/.test(by || '');
expect(auto.executions.length).toBeGreaterThan(0);
expect(auto.executions.every(e => automated(e.started_by))).toBe(true);
expect(manual.executions.some(e => automated(e.started_by))).toBe(false);
expect(auto.executions.some(e => e.id === submit.json.execution_id)).toBe(true);
});
+11
View File
@@ -216,3 +216,14 @@ test('an unanswered prompt fails the execution instead of continuing (#21)', asy
expect(logs(ex, 'prompt_timeout')).toHaveLength(1);
expect(outputs(ex)).toEqual([]);
});
test('the execution list marks runs waiting on a prompt (#3)', async () => {
const id = await start(await createWorkflow([
{ id: 'ask', type: 'prompt', message: 'Proceed?', options: ['Yes'] },
]));
const row = async () => ((await sso('GET', '/api/executions?limit=100')).json.executions || []).find(e => e.id === id);
await waitFor(async () => (await row())?.waiting_for_input === true, { what: 'the list to show it waiting' });
await sso('POST', `/api/executions/${id}/respond`, { response: 'Yes' });
await waitForExecution(id);
expect((await row()).waiting_for_input).toBe(false);
});
+16
View File
@@ -42,3 +42,19 @@ test('an invalid workflow definition is rejected with a message', async ({ page,
await expect(page.locator('#wf-list tr', { hasText: 'Broken definition' })).toHaveCount(0);
expect(problems).toEqual([]); // rejected in the browser, so no failed request either
});
test('a run waiting on a prompt shows as waiting, and the Waiting filter finds it (#3)', async ({ page, request }) => {
const created = await request.post('/api/workflows', { data: { name: `UI wait ${Date.now()}`, definition: { steps: [
{ id: 'ask', type: 'prompt', message: 'Proceed?', options: ['Yes'] },
] } } });
const wf = (await created.json()).id;
const ex = (await (await request.post('/api/executions', { data: { workflow_id: wf } })).json()).id;
await page.goto('/executions');
const row = page.locator(`#ex-list-manual .ex-row[data-execution-id="${ex}"]`);
await expect(row.locator('td[data-label="Status"]')).toHaveText('waiting');
await page.locator('#ex-status').selectOption('waiting');
await expect(row).toBeVisible();
await request.post(`/api/executions/${ex}/respond`, { data: { response: 'Yes' } });
});