think
16px
820px

Drop the dead RAG /sessions passthrough — completion notes

Date: 2026-07-08
Source: integration prompt prompt-ai-ahu-chatbot-drop-rag-sessions.md.
Closes the cross-zone item flagged in
2026-07-08-rag-search-gateway-completion.md. Small cleanup (dead-code
deletion), not a feature — no behavior change for real users.

What changed

Trimmed the two public-web thread-history routes so their cookie-less branch
no longer fetches ai-ahu-document-rag's /sessions*
(a dead DMZ→Internal
call: the upstream endpoints are stubs returning [], history already moved to
the local ThreadStore, and the UI gates the call to Akun users only):

  • api/threads/doc/route.ts — Akun branch unchanged (ThreadStore). The
    cookie-less RAG try/fetch/catch tail → return NextResponse.json([] as Thread[]).
  • api/threads/doc/[id]/route.ts — Akun branch unchanged. The cookie-less
    /sessions/{id}/runs tail → return NextResponse.json({ id, history: [] }).
  • Removed the now-orphaned UPSTREAM const and the threads-upstream imports
    (mapSessionToThread, unwrapList, ServerSession, runToMessages,
    ServerRun) from both files. Tidied a stale TanyaSidebar.tsx comment.

Report back (per the prompt)

  • Routes trimmed: both, as above. Akun (ThreadStore) branch byte-identical.
  • threads-upstream (+ test): KEPT. It still has two importers —
    apps/internal-web/src/app/api/threads/data/route.ts and …/data/[id]/route.ts
    (the staff Data-Agent thread history). Only the public-doc routes were
    trimmed, so the lib is not orphaned.
  • NEXT_PUBLIC_* env entries: NONE removed. Both stay, still referenced:
  • NEXT_PUBLIC_DOC_RAG_API_URL — internal-web admin routes
    (admin/documents, admin/system-status, admin/model-providers),
    rag-proxy, and agent-router.
  • NEXT_PUBLIC_AGNO_API_URL — the DataTool/agent path (native-provider,
    ag-ui-provider, agent-router) and several internal-web hooks/pages.
  • pnpm check: green (public-web 135 / internal-web 65 / streams 17 +
    typecheck + conventions). Typecheck confirmed no orphaned imports.
  • No runtime /sessions fetch remains: grep -rn "/sessions" apps/public-web/src
    returns only comments/docstrings. Added tests: a cookie-less list/detail
    request returns [] / {id, history: []} with fetch asserted not
    called
    .

Deploy

Only ahu-ai-chatbot-public changed → rebuilt that image, recreated ahu-public
(agent-public untouched). Behavior-neutral: guests already got empty history;
Akun history (local ThreadStore) unchanged.