diff options
Diffstat (limited to 'web')
| -rw-r--r-- | web/app.js | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -456,8 +456,11 @@ function renderAllPanel(tasks) { // ── Run action ──────────────────────────────────────────────────────────────── -async function runTask(taskId) { - const res = await fetch(`${API_BASE}/api/tasks/${taskId}/run`, { method: 'POST' }); +async function runTask(taskId, agent) { + const url = agent && agent !== 'auto' + ? `${API_BASE}/api/tasks/${taskId}/run?agent=${agent}` + : `${API_BASE}/api/tasks/${taskId}/run`; + const res = await fetch(url, { method: 'POST' }); if (!res.ok) { let msg = `HTTP ${res.status}`; try { const body = await res.json(); msg = body.error || body.message || msg; } catch {} @@ -467,6 +470,8 @@ async function runTask(taskId) { } async function handleRun(taskId, btn, footer) { + const agentSelector = document.getElementById('select-agent'); + const agent = agentSelector ? agentSelector.value : 'auto'; btn.disabled = true; btn.textContent = 'Queuing…'; @@ -475,7 +480,7 @@ async function handleRun(taskId, btn, footer) { if (prev) prev.remove(); try { - await runTask(taskId); + await runTask(taskId, agent); // Refresh active panel so state flips to QUEUED await poll(); } catch (err) { |
