Merge branch 'worktree-agent-ae6543d03d048d81f'

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 16:10:47 +00:00
28 changed files with 1391 additions and 70 deletions
+49
View File
@@ -0,0 +1,49 @@
// An agent's notify call for captures of the web notification paths. Off by
// default.
//
// `?agentNotice=<ms>` answers subscribe_notifications with no backlog, then
// <ms> after it pushes one `chat_notify` notification
// for the `ui-review` chat (add `ui-review=1` so the
// chat has its title). `agentNoticePriority=2|3|4`
// sets its priority (default 3).
import 'dart:async';
import 'package:pipelines_app/core/api_gateway.dart';
Map<String, String> _params = const {};
void configureAgentNoticeFixture(Map<String, String> params) =>
_params = params;
/// The subscribe reply for [request], or null when the fixture is off or the
/// request is not a subscription. Schedules the push through [emit].
JsonMap? agentNoticeReply(JsonMap request, void Function(JsonMap) emit) {
if (request['type'] != 'subscribe_notifications') return null;
final delay = int.tryParse(_params['agentNotice'] ?? '');
if (delay != null) {
final priority = int.tryParse(_params['agentNoticePriority'] ?? '') ?? 3;
Timer(Duration(milliseconds: delay), () {
emit({
'type': 'notification',
'notification': {
'id': 'chat:ui-review:notify:shown_capture',
'kind': 'chat_notify',
'title': 'Build finished',
'message':
'All 412 tests pass. The release branch is ready to merge.',
'click': 'pipelines://chat/ui-review',
'priority': priority,
'tags': <String>[],
'created_at': DateTime.now().toUtc().toIso8601String(),
'group': 'chat:ui-review',
},
});
});
}
return {
'id': request['id'],
'type': 'notifications_subscribed',
'notifications': <JsonMap>[],
'ids': <String>[],
};
}
+6 -1
View File
@@ -44,6 +44,7 @@ import 'perf/chat_search_fixture.dart';
import 'perf/chat_shown_fixture.dart';
import 'perf/chat_claude_accounts_fixture.dart';
import 'perf/chat_question_fixture.dart';
import 'perf/agent_notice_fixture.dart';
import 'capture/window_probe.dart';
import 'perf/chat_scroll_fixture.dart';
import 'perf/perf_fixture.dart';
@@ -823,7 +824,10 @@ class _FixtureChannel implements WebSocketChannel {
'type': 'status',
'status': {'hostname': hostname},
}
: probeReply(decoded);
: agentNoticeReply(decoded, (frame) {
if (!_incoming.isClosed) _incoming.add(jsonEncode(frame));
}) ??
probeReply(decoded);
final followUps = perfChatFollowUps(decoded);
final subscribe = decoded['chat_subscribe'];
if (subscribe is Map) {
@@ -936,6 +940,7 @@ Future<void> main() async {
return;
}
configurePerfFixture(params);
configureAgentNoticeFixture(params);
installSpeechFixture(params);
if (params['files'] == '1') {
probeMissingRememberedFolder = params['filesMissing'] == '1';