Skip to content

fix(cache): the per-type cache clear is broken end to end, and its backend returns success for no-ops #19801

Open

Description

@mrveiss

Problem

The per-type cache clear is broken end to end, and its backend reports success for work it does not do.

  • The SLM calls a path that does not exist. autobot-slm-frontend/src/composables/useAutobotApi.ts clearCache() posts /cache/clear?type=X. The backend route is POST /cache/clear/{cache_type} (autobot-backend/api/cache_management.py). The three buttons in views/settings/admin/CacheSettings.vue (clearCache('knowledge'), ('llm'), ('config')) therefore fail.
  • The backend handler is a stub that answers success:
    • llm logs "not implemented yet" and returns status: success.
    • knowledge logs a line and returns "Knowledge base cache cleared" without clearing anything.
    • config, which the SLM offers, is a 400 ("Available: llm, knowledge").

Fixing only the path would turn a visible failure into a false success. That is worse.

Found while auditing the retired main-GUI SettingsPanel.vue for #19532, whose clearCacheType called the same stub.

Decision needed

For each type the UI offers, either implement a real clear (say what it clears: which Redis keys, which in-process caches, and on which nodes), or remove the type from both the UI and the endpoint. Never return success for a no-op. The audit rule for destructive admin actions (#17038) applies to whatever is implemented.

Acceptance criteria

  • Every type the SLM offers reaches a handler that clears what it names, or the type is gone from both sides.
  • No branch returns status: success without clearing.
  • The SLM client posts to the route that exists; a test covers the path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions