fix(librarian): expose page_id in wiki search results

search_wiki printed ordinally numbered results with no page ID while
get_wiki_page demands 'the page ID from search results' - the model
passed the list position (page 1) and 404'd. Results now carry
page_id and drop the ordinals.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 15:37:00 +02:00
co-authored by Claude Fable 5
parent 9184b48673
commit a8bc282576
+7 -4
View File
@@ -246,11 +246,14 @@ async def search_wiki(
output_parts = [f"## Wiki Search: {query}\n"]
for i, page in enumerate(results, 1):
output_parts.append(f"{i}. **{page.title}**")
output_parts.append(f" Path: {page.path}")
# No ordinal numbering: small models pass the list position to
# get_wiki_page instead of the page ID unless the ID is the only
# number in sight.
for page in results:
output_parts.append(f"- **{page.title}** (page_id: {page.id})")
output_parts.append(f" Path: {page.path}")
if page.description:
output_parts.append(f" {page.description}")
output_parts.append(f" {page.description}")
output_parts.append("")
return "\n".join(output_parts)