Skip to content

fix: add dev API key support and demo flow improvements - #64

Merged
suguanYang merged 16 commits into
stagingfrom
bugfix/wangbinqi/add-dev-api-key
May 13, 2026
Merged

suguanYang merged 16 commits into
stagingfrom
bugfix/wangbinqi/add-dev-api-key

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • Support KNOWHERE_API_KEY for local development, bypassing Dashboard auth
  • Fix demo citation chunk ID mapping to materialized document IDs
  • Make document reconciliation client-driven with atomic deduplication
  • Skip workspace DB queries for non-UUID demo source chunk requests
  • Style and responsive fixes for chunk panel, text previews, and dashboard link

suguanYang added 15 commits May 13, 2026 02:52
Replace raw fetch/async/try-catch/throw with Effect.gen, Effect.fn,
Effect.tryPromise, and structured error handling across foundations,
domain logic, route services, and API handlers.
Replace the automatic reconcileStaleSources background sweep with inline,
per-source triggers that fire only when the client polls for source state.
Add three-layer protection against duplicate workflow runs: Upstash
idempotency via workflowRunId, in-memory dedup, and an atomic DB guard
(UPDATE WHERE status='parsing') so concurrent workflows cannot both
finalize the same source.
After demo materialization, source rows get new materialized document IDs
but the seeded demo-thread citations still reference the canonical IDs.
Wire up the existing replaceDemoCitationDocumentId to remap citations
after materialization completes, so source citation resolution continues
to work.
Two changes to complete the citation fix after demo materialization:

1. route-chunks: when serving chunks for a materialized demo source, use
   the source's knowhereDocumentId as the chunk documentId instead of the
   canonical one, so chunk resolution finds matching citations.

2. workspace-chat-workflow: after materialization, re-fetch the chat thread
   from the server instead of remapping citation documentIds client-side.
   The server-side fix (prior commit) already persisted the corrected
   citations; this just gets fresh data to the client.

Also hide the materialization status text from the user — it now shows
"Thinking" like a normal send.
Non-UUID source IDs can only be demo sources. Short-circuit
loadSourceChunksEffect before getCurrentUser/ensureWorkspace to avoid
unnecessary DB queries on every demo chunk page load. Also caches the
upstream demo chunk API response for 5 minutes.
@vercel

vercel Bot commented May 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
knowhere-notebook-staging Ready Ready Preview, Comment May 13, 2026 9:53am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
knowhere-notebook Ignored Ignored Preview May 13, 2026 9:53am

Request Review

Drop the #chunk-<id> URL hash navigation and the LayoutDashboard icon
prefix from the top-nav dashboard link.
@suguanYang
suguanYang merged commit 55a6cf7 into staging May 13, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant