ai: ground the librarian — collection links, retry hints, no source URLs

Live testing surfaced three ways small models went wrong summarizing a
library: they gave up after one empty search (misspelled channel names
found nothing), so zero-result searches now carry a retry hint and the
Research prompt requires list_collections before channel/site questions
and search_videos(channel_id) before claiming a channel is summarized;
they presented the familiar YouTube source URL instead of the WROLPi
link, so listings omit the source URL (archive detail keeps it); and
they invented links for channels, so channel collections now carry
their real /videos/channel page link.  Search descriptions state that
search_str is optional for browsing the newest items.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-08-27 12:44:37 -06:00
parent 08888a3d8f
commit 1ee35c6bda
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
4 changed files with 40 additions and 17 deletions

View file

@ -70,7 +70,9 @@ def test_format_file_group_archive():
assert result['kind'] == 'archive'
assert result['link'] == '/archives/8'
assert result['text_link'] == '/api/ai/archives/8/text'
assert result['url'] == 'https://example.com/a'
# Listings omit the source URL so small models present the WROLPi link instead.
assert 'url' not in result
assert lib.format_file_group(fg, include_url=True)['url'] == 'https://example.com/a'
def test_format_file_groups_total():