Repository navigation
fix(fanout): classify intents progressively — visible page first, background chunks - #448
Merged
Merged
Conversation
…kground chunks The Query Fan-out tab requested intent classification for every observed sub-query in a single call. On a cold cache that one request serialized dozens of LLM waves (120 queries ~= 40s+), blew past the server action's 20s fetch timeout (#428), and the badges never arrived that session. Classify progressively instead: the visible page's 10 queries go first (one request, at most ~2 LLM waves), then the remainder in background chunks of 20, each merged into state as it resolves. The table never waits on classification, a failed chunk only leaves its own rows unbadged, and a reload/brand switch cancels the stale chain via a run counter. Already-classified queries are skipped on silent reloads. Closes #431
4 tasks done
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
The Query Fan-out tab requested intent classification for every observed sub-query in a single call. On a cold cache that one request serialized dozens of LLM waves (120 queries ≈ 40s+), blew past the server action's 20s fetch timeout (#428), and the badges never arrived that session — the server kept classifying and persisting, so they only showed up on a later visit.
This PR classifies progressively, client-side only:
No server changes —
/api/prompts/fanout-intentsalready accepts arbitrary batch sizes and caches per query.Related issue
Closes #431
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
fanout_query_intentsto simulate a cold cache.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)