[PR #90] [MERGED] fix: read KB files from /knowledge/{id}/files endpoint (#89) #106

Closed
opened 2026-10-18 21:14:24 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/oikb/pull/90
Author: @plevart
Created: 7/31/2026
Status: ✅ Merged
Merged: 9/16/2026
Merged by: @tjbck

Base: main ← Head: fix/validate-deep-file-count


📝 Commits (1)

  • 9b97a3a fix: read KB files from /knowledge/{id}/files endpoint (#89)

📊 Changes

2 files changed (+16 additions, -5 deletions)

View changed files

📝 src/oikb/cli.py (+2 -2)
📝 src/oikb/client.py (+14 -3)

📄 Description

validate --deep, status, and ls derived the KB file list from GET /knowledge/{id}, whose files field is a server-hydrated convenience that Open WebUI version 0.11.0 returns as null. Reading len(kb.get("files", [])) then crashed with "object of type 'NoneType' has no len()" because .get()'s default only applies to a missing key, not an explicit null. ls silently printed "(empty)" for the same reason. Sync was unaffected as it uses the server-side /sync/diff endpoint.

Point the file listing at the real GET /knowledge/{id}/files endpoint (returns {items, total}): fix list_kb_files, add count_kb_files for the authoritative total, and use them in the affected commands.

Fixes #89


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/oikb/pull/90 **Author:** [@plevart](https://github.com/plevart) **Created:** 7/31/2026 **Status:** ✅ Merged **Merged:** 9/16/2026 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `main` ← **Head:** `fix/validate-deep-file-count` --- ### 📝 Commits (1) - [`9b97a3a`](https://github.com/open-webui/oikb/commit/9b97a3a4415752163d9a1186d09ddca640d79b13) fix: read KB files from /knowledge/{id}/files endpoint (#89) ### 📊 Changes **2 files changed** (+16 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/oikb/cli.py` (+2 -2) 📝 `src/oikb/client.py` (+14 -3) </details> ### 📄 Description `validate --deep`, `status`, and `ls` derived the KB file list from `GET /knowledge/{id}`, whose `files` field is a server-hydrated convenience that Open WebUI version 0.11.0 returns as null. Reading `len(kb.get("files", []))` then crashed with "object of type 'NoneType' has no len()" because .get()'s default only applies to a missing key, not an explicit null. `ls` silently printed "(empty)" for the same reason. Sync was unaffected as it uses the server-side /sync/diff endpoint. Point the file listing at the real `GET /knowledge/{id}/files` endpoint (returns {items, total}): fix list_kb_files, add count_kb_files for the authoritative total, and use them in the affected commands. Fixes #89 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:14:24 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/oikb#106
No description provided.