[PR #108] [CLOSED] Fix empty ls and status crash when the KB payload has files: null #115

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

📋 Pull Request Information

Original PR: https://github.com/open-webui/oikb/pull/108
Author: @SAY-5
Created: 8/23/2026
Status: ❌ Closed

Base: main ← Head: fix-kb-files-listing


📝 Commits (1)

  • add07e0 Use the /knowledge/{id}/files endpoint to list KB files

📊 Changes

2 files changed (+20 additions, -4 deletions)

View changed files

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

📄 Description

Fixes #10. Recent Open WebUI returns "files": null from GET /knowledge/{id} and serves the file list from the paginated /knowledge/{id}/files route instead, so oikb ls always came back empty and oikb status crashed with TypeError: object of type 'NoneType' has no len(). list_kb_files now calls the /files endpoint (following its own docstring) and pages through the results, falling back to the old KB payload on 404 for older servers; status and the doctor deep check no longer trip over a null files field. Verified against a mocked server for the paginated, legacy and empty cases.


🔄 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/108 **Author:** [@SAY-5](https://github.com/SAY-5) **Created:** 8/23/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-kb-files-listing` --- ### 📝 Commits (1) - [`add07e0`](https://github.com/open-webui/oikb/commit/add07e007561378bf0ff284f5c89e779b5eddc21) Use the /knowledge/{id}/files endpoint to list KB files ### 📊 Changes **2 files changed** (+20 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/oikb/cli.py` (+2 -2) 📝 `src/oikb/client.py` (+18 -2) </details> ### 📄 Description Fixes #10. Recent Open WebUI returns `"files": null` from `GET /knowledge/{id}` and serves the file list from the paginated `/knowledge/{id}/files` route instead, so `oikb ls` always came back empty and `oikb status` crashed with `TypeError: object of type 'NoneType' has no len()`. `list_kb_files` now calls the `/files` endpoint (following its own docstring) and pages through the results, falling back to the old KB payload on 404 for older servers; `status` and the doctor deep check no longer trip over a null files field. Verified against a mocked server for the paginated, legacy and empty cases. --- <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:28 +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#115
No description provided.