feat: live progress updates during orchestrator tool loop

The thinking bubble now shows real-time status instead of a static spinner:
   Round 1 — thinking…
   Round 1 — web_search
   Round 2 — thinking…
   Generating response…

Implementation: async on_progress callback passed from _run_job into both
orchestrators (_run_from_messages / _run_from_contents). Callback writes to
job["progress"] under the jobs lock; poll responses include the field;
app.js displays it in the thinking bubble when present.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-16 22:55:14 -04:00
parent 4fdb9fd0c7
commit c31eba111f
4 changed files with 37 additions and 4 deletions

View File

@@ -1490,11 +1490,16 @@
if (!pollRes.ok) throw new Error(`Poll failed: HTTP ${pollRes.status}`);
job = await pollRes.json();
const n = job.tool_calls?.length || 0;
if (job.status === 'queued' || job.status === 'running') {
thinkingDiv.textContent = n
? `⚡ working… (${n} tool${n !== 1 ? 's' : ''} used)`
: '⚡ working…';
const prog = job.progress;
const n = job.tool_calls?.length || 0;
if (prog) {
thinkingDiv.textContent = `${prog}`;
} else {
thinkingDiv.textContent = n
? `⚡ working… (${n} tool${n !== 1 ? 's' : ''} used)`
: '⚡ working…';
}
continue;
}