Improve chat session catalog creation
This commit is contained in:
@@ -292,5 +292,25 @@ void main() {
|
||||
expect(gateway.calls.single.fields['chat_query']['limit'], 200);
|
||||
},
|
||||
);
|
||||
test(
|
||||
'reads exact directory/backend catalog envelopes without inventing fallback',
|
||||
() async {
|
||||
gateway.reply = {
|
||||
'chat_directories': ['~', '/work'],
|
||||
};
|
||||
expect(await repo.directories(), ['~', '/work']);
|
||||
expect(gateway.calls.last.type, 'chat_directories');
|
||||
expect(gateway.calls.last.fields, isEmpty);
|
||||
gateway.reply = {
|
||||
'chat_backends': ['opencode', 'claude'],
|
||||
};
|
||||
expect(await repo.backends(), ['opencode', 'claude']);
|
||||
expect(gateway.calls.last.type, 'chat_backends');
|
||||
expect(gateway.calls.last.fields, isEmpty);
|
||||
gateway.reply = {};
|
||||
await expectLater(repo.directories(), throwsStateError);
|
||||
await expectLater(repo.backends(), throwsStateError);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user