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
+18
View File
@@ -12,6 +12,7 @@
// them, and keeps colours picked with chat_color;
// `?activity=1` (with `?chats=N`) lists a running chat, one with
// background tasks and idle ones;
// `?automations=N` reports N native automations for the selected chat;
// `?msgs=`, `?rich=1`, `?older=1`, `?live=N` vary the chat transcripts for
// scroll captures (tool/perf/chat_scroll_fixture.dart).
// `?question=` pushes an agent question (tool/perf/chat_question_fixture.dart).
@@ -282,6 +283,23 @@ JsonMap? perfChatReply(JsonMap request) {
? backgroundTaskFixture()
: const [],
};
case 'chat_automations':
final query = request['chat_query'];
final session = query is Map ? '${query['session_id'] ?? ''}' : '';
final count = int.tryParse(_params['automations'] ?? '');
return {
'id': id,
'type': 'chat_automations',
'chat_automations': count == null
? {'session_id': session, 'status': 'unavailable'}
: {
'session_id': session,
'provider': _harness,
'status': 'supported',
'active_count': count,
'observed_at_ms': DateTime.now().millisecondsSinceEpoch,
},
};
case 'chat_shell_output':
final outputQuery = request['chat_shell_output_query'];
final outputId = outputQuery is Map ? outputQuery['shell_id'] : null;