Questions: agents write their findings before asking; an open question isn't 'Stopped'
An agent put its whole analysis in thinking (not shown) and asked a question straight away, so the operator saw only the question form under a 'Stopped after 2 tools' row. The Pipelines tool instructions now tell agents to write what they found before asking, and an activity row with an open question reads '... · waiting for your answer'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/chat/domain/chat_turn_activity.dart';
|
||||
|
||||
Map<String, dynamic> _tool(String name, String status) => {
|
||||
'type': 'tool',
|
||||
'id': name,
|
||||
'name': name,
|
||||
'state': {'status': status, 'title': ''},
|
||||
};
|
||||
|
||||
void main() {
|
||||
test('an open question reads as waiting for the operator, not stopped', () {
|
||||
final activity = ChatTurnActivityData([
|
||||
_tool('Bash', 'completed'),
|
||||
_tool('AskUserQuestion', 'pending'),
|
||||
], streaming: false);
|
||||
expect(activity.label, 'Used 2 tools · waiting for your answer');
|
||||
});
|
||||
|
||||
test('an answered question is an ordinary used tool', () {
|
||||
final activity = ChatTurnActivityData([
|
||||
_tool('Bash', 'completed'),
|
||||
_tool('AskUserQuestion', 'completed'),
|
||||
], streaming: false);
|
||||
expect(activity.label, 'Used 2 tools');
|
||||
});
|
||||
|
||||
test('another interrupted tool still reads as stopped', () {
|
||||
final activity = ChatTurnActivityData([
|
||||
_tool('Bash', 'completed'),
|
||||
_tool('Read', 'interrupted'),
|
||||
], streaming: false);
|
||||
expect(activity.label, 'Stopped after 2 tools');
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user