Skip to content

Fix: Knowledge categories page shows hardcoded data for non-admin users #910

Description

@mrveiss

Problem

/knowledge/categories page appears to work but silently shows hardcoded fake category data for non-admin users instead of real data.

Root Cause (from debug-autobot investigation)

  1. /api/knowledge_base/categories/main requires check_admin_permission dependency
  2. Non-admin users get a 401/403 from the backend
  3. Frontend silently catches the error and falls back to 3 hardcoded category stubs
  4. No error is shown — users see fake data with no indication of failure

Fix Plan

Fix A: Remove admin requirement from /api/knowledge_base/categories/main

  • The 3 main categories (autobot-documentation, system-knowledge, user-knowledge) are public metadata, not sensitive data
  • Any authenticated user should be able to list the top-level categories in their own knowledge base

Fix B: Add proper frontend error handling

  • Show a real error message (or 'requires admin' notice) instead of silently falling back to hardcoded data
  • Add loading/error UI state to the categories load path in KnowledgeBrowser.vue and KnowledgeCategories.vue

Impact

High — all non-admin users see wrong data on the knowledge categories page with no indication anything is wrong

Activity

  1. mrveiss commented on Feb 17, 2026

    @mrveiss
    OwnerAuthor

    ✅ Implemented in commit 958f937 on Dev_new_gui

    Changes (2 files, +89/-7 lines):

    Backend (api/knowledge.py):

    • GET /api/knowledge_base/categories/main now uses get_current_user instead of check_admin_permission
    • Any authenticated user can view the 3 top-level knowledge categories

    Frontend (KnowledgeCategories.vue):

    • Added isLoadingCategories + categoriesError reactive refs
    • Loading spinner during categories fetch
    • Explicit error messages for 401 (auth required) / 403 (no permission) instead of silent empty state
    • Retry button on error
    • Response structure validation before accepting data

    Verification:

    • ✅ Backend lint (flake8, isort, black) — all passed
    • ✅ Frontend type-check — no errors
    • ✅ Pre-commit hooks — all passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions