Give the capture fixture chat thinking levels

This commit is contained in:
2026-11-09 20:19:20 +00:00
parent b57405df29
commit 66e6a7cb73
3 changed files with 52 additions and 1 deletions
+1 -1
View File
@@ -165,4 +165,4 @@ over the inactive pane must change its own offset without activating it;
at its bottom `pixels` reaches `max` and its `viewport` equals the small
visible height. Use `film=key:chat-peek-<pane-id>` to record the swap.
Chat header grouping: `?chats=2&header=1` supplies a model and permission mode to the fixture chat so the selector island and Files/More island can both be reviewed.
Chat header grouping: `?chats=2&header=1` supplies a model, permission mode and thinking levels (answering `chat_effort`, tool/perf/chat_effort_fixture.dart) to the fixture chat so the selector island and Files/More island can both be reviewed.
+47
View File
@@ -0,0 +1,47 @@
import 'package:pipelines_app/core/api_gateway.dart';
/// `?header=1` thinking levels: the fixture model's levels as a Codex
/// model/list reports them, and the level each chat last chose.
const _levels = [
{
'id': 'low',
'name': 'Low',
'description': 'Fast responses with lighter reasoning',
},
{
'id': 'medium',
'name': 'Medium',
'description': 'Balances speed and reasoning depth',
},
{
'id': 'high',
'name': 'High',
'description': 'Greater reasoning depth for complex problems',
},
{
'id': 'xhigh',
'name': 'Extra high',
'description': 'Extra high reasoning depth for complex problems',
},
];
final Map<String, String> _chosen = {};
/// The row fields a server sends for a chat whose model has levels.
JsonMap chatEffortRowFields(String id) => {
'effort': _chosen[id] ?? '',
'efforts': _levels,
'default_effort': 'medium',
};
/// The `chat_effort` reply: the stored level with the model's levels.
JsonMap chatEffortReply(JsonMap request) {
final body = request['chat_effort'];
final id = body is Map ? '${body['session_id'] ?? ''}' : '';
final effort = body is Map ? '${body['effort'] ?? ''}' : '';
_chosen[id] = effort;
return {
'type': 'chat_effort',
'chat_effort': {'session_id': id, ...chatEffortRowFields(id)},
};
}
+4
View File
@@ -22,6 +22,7 @@
// (tool/perf/chat_new_session_fixture.dart).
import 'package:pipelines_app/core/api_gateway.dart';
import 'chat_effort_fixture.dart';
import 'chat_new_session_fixture.dart';
import 'chat_turn_diff_fixture.dart';
import 'chat_question_fixture.dart';
@@ -86,6 +87,7 @@ JsonMap _chatRow(int i) {
'model': 'openai/gpt-6.1',
'mode': 'default',
'mode_name': 'Ask for permission',
...chatEffortRowFields(id),
},
// Server-shaped handoff facts (chat_sessions rows carry them).
if (_harness != 'opencode') 'backend': _harness,
@@ -238,6 +240,8 @@ JsonMap? perfChatReply(JsonMap request) {
if (shell != null) return shell;
final id = request['id'];
switch ('${request['type']}') {
case 'chat_effort':
return {'id': id, ...chatEffortReply(request)};
case 'chat_sessions':
return {
'id': id,