fix: add dev API key support and demo flow improvements - #64
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Drop the #chunk-<id> URL hash navigation and the LayoutDashboard icon prefix from the top-nav dashboard link.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
KNOWHERE_API_KEYfor local development, bypassing Dashboard auth