diff options
| author | Claudomator Agent <agent@claudomator> | 2026-03-14 07:04:47 +0000 |
|---|---|---|
| committer | Claudomator Agent <agent@claudomator> | 2026-03-14 07:04:47 +0000 |
| commit | e0e81bbdaae37353803d47fa59a36d0472f8146d (patch) | |
| tree | f4ca72b78926edd4a37acfc9feebc1bf30c2aee9 /web | |
| parent | e5864d941e31a0e4ce59e31bee13e9c7c43909f4 (diff) | |
feat: persist agent assignment before task execution
- Add UpdateTaskAgent to Store interface and DB implementation
- Call UpdateTaskAgent in Pool.execute to persist assigned agent/model
to database before the runner starts
- Update runTask in app.js to pass selected agent as query param
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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) { |
