Knowledge-bank operations routes 404 in the control plane (no proxy for /operations and /operations/{id})

Aperta Adatta ai principianti
#6,923 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
next.js, python, typescript
Ambito
api, backend

Direzione di ricerca

Inizia leggendo gli handler proxy esistenti in app/api/knowledge-banks/[bankId]/documents e app/api/knowledge-banks/[bankId]/tags, poi controlla i metodi SDK citati nell’issue per confermare le route e i metodi previsti. Aggiungi le route proxy per le operazioni elencate seguendo questi schemi. Il lavoro è concluso quando le richieste di elenco, dettaglio, annullamento, nuovo tentativo ed eliminazione raggiungono il piano dati e restituiscono la sua risposta invece di un 404 del piano di controllo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Description

The control plane (1.3.0) has no proxy routes for knowledge-bank background operations, so the knowledge-bank Settings → Background operations panel can never load them. The UI request

GET /api/knowledge-banks/<bank>/operations?limit=10&exclude_parents=true

returns 404 (Next.js HTML not-found page), while the same query against the data plane works:

GET /v1/default/knowledge-banks/<bank>/operations?limit=10&exclude_parents=true
→ 200 {"bank_id":"personal-kb","total":48,"limit":10,...}

The panel therefore renders as "0 operations / nothing here" even when the bank has dozens of completed ingest operations, and the retry / cancel / delete actions for those jobs are unreachable from the UI.

Every other knowledge-bank route is proxied; only operations (and its per-operation children) are missing, even though the control-plane client SDK already calls them.

Steps to Reproduce

  1. Self-hosted data plane 1.3.0 + control plane 1.3.0 (@vectorize-io/hindsight-control-plane 1.3.0, Next.js 16.4.6), knowledge banks enabled.
  2. Create a knowledge bank and ingest files so the bank has operations:
    curl -F "[email protected]" -H "Authorization: Bearer <token>" \
      http://<data-plane>:18888/v1/default/knowledge-banks/personal-kb/files/ingest
    
  3. In the control plane UI: Knowledge banks → personal-kb → Settings (设置). The "Background operations" (后台操作) panel appears under Settings.
  4. Watch the browser network tab — the page issues, and the server answers:
    GET /api/knowledge-banks/personal-kb/operations?limit=10&exclude_parents=true  → 404
    
    (twice, once per render). The panel shows "0 operations" / "暂无操作".
  5. Compare the same requests against the data plane directly — all 200:
    GET /v1/default/knowledge-banks/personal-kb/operations?limit=10&exclude_parents=true  → 200 {"total":48,...}
    GET /v1/default/knowledge-banks/personal-kb/operations/<operation_id>                  → 200
    

Expected Behavior

The control plane proxies knowledge-bank operations like it proxies every other knowledge-bank route, so that:

  • the Settings → Background operations panel lists the bank's operations (all / pending / processing / completed / failed / cancelled),
  • GET /api/knowledge-banks/<bank>/operations/<operation_id> returns the operation,
  • the retry / cancel / delete actions on an ingest operation reach the data plane instead of 404ing.

Actual Behavior

GET  /api/knowledge-banks/<bank>/operations?limit=10&exclude_parents=true        → 404 (CP)
GET  /api/knowledge-banks/<bank>/operations/<operation_id>                       → 404 (CP)

The panel silently degrades to "0 operations / 暂无操作" (the 404 is swallowed client-side), and retry/cancel/delete for knowledge-bank jobs cannot be exercised from the control plane at all.

Version

  • data plane / API: 1.3.0 (self-hosted, Linux x86_64, pip)
  • control plane: @vectorize-io/hindsight-control-plane 1.3.0, Next.js 16.4.6, standalone build pxxVwxeWHJuSuoXyFwKoh
  • observed 2026-11-26

LLM Provider

Other — OpenAI-compatible endpoint; unrelated to this bug (no LLM call on this path).

Root cause

The control-plane build only ships these knowledge-bank API routes (app/api/knowledge-banks/**):

/api/knowledge-banks
/api/knowledge-banks/[bankId]
/api/knowledge-banks/[bankId]/config
/api/knowledge-banks/[bankId]/documents
/api/knowledge-banks/[bankId]/documents/[documentId]
/api/knowledge-banks/[bankId]/documents/[documentId]/file
/api/knowledge-banks/[bankId]/documents/[documentId]/passages/[index]/media
/api/knowledge-banks/[bankId]/files/ingest
/api/knowledge-banks/[bankId]/ingest
/api/knowledge-banks/[bankId]/search
/api/knowledge-banks/[bankId]/stats/timeseries
/api/knowledge-banks/[bankId]/tags

The data plane exposes (relevant ones missing on the CP):

GET    /v1/default/knowledge-banks/{bank_id}/operations
DELETE /v1/default/knowledge-banks/{bank_id}/operations
GET    /v1/default/knowledge-banks/{bank_id}/operations/{operation_id}
DELETE /v1/default/knowledge-banks/{bank_id}/operations/{operation_id}
POST   /v1/default/knowledge-banks/{bank_id}/operations/{operation_id}/retry
POST   /v1/default/knowledge-banks/{bank_id}/operations/{operation_id}/delete

and the control-plane client SDK already has the matching methods generated —

listKnowledgeBankOperations(bankId, opts)
getKnowledgeBankOperation(bankId, operationId, opts)
cancelKnowledgeBankOperation(bankId, operationId)
retryKnowledgeBankOperation(bankId, operationId)
deleteKnowledgeBankOperation(bankId, operationId)

— which build /api/knowledge-banks/{bank}/operations[...] URLs. So the UI / SDK is ahead of the proxy layer: the routes are called but do not exist.

This is likely fallout from #6791 ("no /banks/{bank_id} endpoint serves a knowledge bank; knowledge banks get their own job endpoints") — the data plane gained /knowledge-banks/{bank_id}/operations, but the control-plane proxy did not gain the matching routes.

Suggested fix

Add the missing proxy route handlers under the control plane, alongside the existing knowledge-bank routes:

app/api/knowledge-banks/[bankId]/operations/route.ts                       # GET, DELETE
app/api/knowledge-banks/[bankId]/operations/[operationId]/route.ts        # GET, DELETE
app/api/knowledge-banks/[bankId]/operations/[operationId]/retry/route.ts  # POST
app/api/knowledge-banks/[bankId]/operations/[operationId]/delete/route.ts # POST

each forwarding to the data plane's /v1/default/knowledge-banks/{bank_id}/operations... path (same pattern as [bankId]/documents and [bankId]/tags), and to error out with the data plane's status instead of a Next.js 404 page.

Side note: the same missing routes may also break any UI flow that polls a knowledge-bank ingest operation for progress — the SDK call is there, the route is not.

Lingua principale
Python
Stelle
45.2k
Fork
5.9k
Merge medio
6h 18m
PR unite (30g)
354

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vectorize-io/hindsight

Tutte le issue di vectorize-io/hindsight

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.