Show session automation counts in chat composer

This commit is contained in:
2026-11-08 16:40:53 +00:00
parent 3fbfb85ace
commit b7f439a94f
13 changed files with 716 additions and 89 deletions
@@ -0,0 +1,40 @@
# Composer automation manager review findings
Resolved manager review findings (covered by focused regressions):
- Refresh must use REAL protocol shapes, not guessed kind substrings. chat_event
kind is "step" with step.status="ended" (and intermediate=false for final turn)
or kind="tool" with part.state.status="completed"/"error". See existing
chat_foundation_test.dart / chat_thread_fixtures.dart. There are no kinds
containing "complete"/"finished"/"settled". Check session_id BEFORE scheduling;
events from other chats must not refresh this controller.
- Reset the automation in-flight/debounce state on server/session replacement.
Current reconnect leaves _automationRequest nonnull, so the new session skips
its initial read while the old request runs and never recovers. Drop old request
ownership (generation still rejects its result), load the new session, and
coalesce a trailing refresh if a real completion event arrives during a read.
- The domain parser must only expose count for status="supported", with a valid
nonnegative integer and matching expected session_id. Do not expose a number
supplied alongside unavailable, truncate fractional counts, or accept another
session. Guard malformed/out-of-range observed timestamps without throwing.
- Opening the existing inspector should refresh metadata. Preserve shell-list
failures separately from valid automation state and give accessible full text
for both rather than losing automation information behind a shell error label.
- Native automation-only chats need an appropriate inspector title, not a
misleading "Background tasks" title. Keep friendly UI availability copy.
- Exercise the combined caption inside the REAL composer at narrow width and
large text scale, not just a standalone chip. Keep input usable with stop/send
and attach controls, full accessible text and no overflow.
Add regressions for these behaviors, including late old-session results and an
actual step-ended frame causing a refreshed automation count. Preserve old-server
compatibility and background task details; no full suites or duplicate captures.
Manager has directly added the reconnect/request/debounce reset and an async
boundary around automation reads. Metadata changes notify after completion even
for reconnect(notify:false), otherwise a slower automation-only reply never
becomes visible after the shell list has already finished. Add a regression for
that delayed reply and preserve these compatible changes. Constructor/replace
with a synchronously throwing legacy gateway must not notify during widget build.
Final integration: 146 tests passed, analyzer clean; inspected browser captures.
+17
View File
@@ -0,0 +1,17 @@
# Chat automation count
The existing composer work control shows positive session-owned automation and
background task counts, with singular/plural labels and an automation-only state.
Unknown metadata stays unknown; the inspector explains unavailable connections
and shows the last native observation time. No extra composer row was added.
Manager recovered canceled run 293 directly after its wrong whole-suite command.
Real completion events refresh metadata; session replacement rejects stale replies
and resets request ownership. Tests cover reconnect races, protocol validation,
old-server compatibility, and a 360px composer at double text scale.
Verification: 146 focused integration tests passed (watchdog out.gjYPyi), analyzer
clean. Material dark and Cupertino light 560px captures plus 1280px automation-only
captures under /tmp/review/chat-automations-* were inspected. Captions and inspector
fit; initial Cupertino/wide shots caught message loading, subsequent inspector shots
show rendered content. No device verification or deployment in this commit.