fix(webui): update usage and tool progress during active turns (#6553)

* fix(webui): stream model status and usage during active turns

* fix(webui): keep live rounds and active-run status consistent

* fix(webui): reuse existing run indicators without extra status text

* fix(webui): preserve live activity and batch durable delivery

Cancel and drain sibling tools when progress notifications fail, retain balanced checkpoints, and keep model telemetry separate from answer provenance.

Group-commit already queued activity at the channel delivery boundary while preserving FIFO, generation ownership, per-envelope admission, and commit-before-fanout semantics. Isolate invalid members without dropping valid neighboring events.

Retain tool detail lazy grouping and cover scheduling, cancellation, persistence, encoding failures, and projection regressions.

* test(webui): separate standard-library imports in batch regression

* test: tighten live execution checks and clarify contracts

* refactor: remove redundant live execution comments

* refactor: settle tool results through one output path
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-04 16:27:24 +08:00
1 parent 006a535537
commit 8ff04aad2b
52 files changed
+2065 -211

No files matched your search

+5 -3
View File
@@ -97,7 +97,7 @@ async def test_provider_can_emit_without_an_event_specific_runner_callback():
initial_messages=[{"role": "user", "content": "hello"}],
events=EventSink(observe),
))
assert received == [event]
assert received.count(event) == 1
async def test_runner_propagates_context_governance_failure():
@@ -347,7 +347,8 @@ async def test_native_compaction_uses_provider_request_boundary(
compaction_events: list[ContextCompactionEvent] = []
async def observe_compaction(event: ContextCompactionEvent) -> None:
compaction_events.append(event)
if isinstance(event, ContextCompactionEvent):
compaction_events.append(event)
result = await AgentRunner().run(make_run_spec(
provider,
@@ -530,7 +531,8 @@ async def test_repeated_pressure_advances_summary_boundary(monkeypatch):
compaction_events: list[ContextCompactionEvent] = []
async def observe_compaction(event: ContextCompactionEvent) -> None:
compaction_events.append(event)
if isinstance(event, ContextCompactionEvent):
compaction_events.append(event)
result = await AgentRunner().run(make_run_spec(
provider,