docs(KB-056): add inline comment explaining GET /models empty array behavior

- Document why /models returns 200 with empty array instead of 404

- Clarify frontend empty state handling expectation
This commit is contained in:
gsxdsm
2026-03-29 23:23:00 -07:00
parent fd9a1b186a
commit 2fc6c0ac19

View File

@@ -2143,6 +2143,8 @@ async function refreshPrInBackground(store: TaskStore, taskId: string, currentPr
function registerModelsRoute(router: Router, modelRegistry?: ModelRegistryLike): void {
router.get("/models", (_req, res) => {
try {
// Always return 200 with empty array instead of 404 when no models available.
// This ensures the frontend can handle empty states gracefully.
if (!modelRegistry) {
res.json([]);
return;