Repository navigation
Conversation
…esponse fields, Prisma enums - processEmbeddingRun declares its return type. The inferred union dropped umapProjection, and the route cast its result to a local copy to get it back. - Drop canvas.store fitToSpread (the canvas route has its own), the unread requestedTokens, and the considered/readFailures response fields. - ChatThreadStatus, ChatMessageRole and RunStatus come from the Prisma enums instead of hand-copied unions, so the six casts that hid the copies go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Closing as a duplicate of #364, which made the same fixes and is already merged to main. |
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.
This PR fixes the hits from a data-flow measurement of Visual Notes: one cast that patched a lost field, three unused values, two unread response fields, and three hand-copied enum types.
User impact: None. The embeddings page still shows the UMAP projection summary after "Process more" and "Process changed".
What changed
processEmbeddingRundeclares its return type. The function returnsumapProjectionon its main path, but not on its early returns. TypeScript's inferred union dropped the optional field, soroutes/embeddings/[id].tsxcast the result to a localProcessEmbeddingResultto get it back.ProcessEmbeddingResultandUmapProjectionSummaryare now exported fromembeddings.server.ts. The route's copy and both casts are gone.fitToSpreadremoved fromcanvas.store.ts. Nothing called it:routes/canvas.tsxhas its ownfitToSpread, which animates throughanimateToView.requestedTokensremoved fromgetContextLimitExceededinembeddings.utils.ts. It was declared and written, never read.consideredandreadFailuresremoved from the responses ofprocessPathRoundandscanRelativeImages, and fromScanRelativeImagesResult. The docs index reads onlyupdated,failedandmatches. The counters and their log lines stay.ChatThreadStatus,ChatMessageRoleandRunStatuscome from the Prisma enums. They were hand-copied string unions inai-chat.queries.tsandai-runs.queries.ts. The query modules now re-export the Prisma types, so every importer is unchanged, and the six casts that hid the copies are gone.Proof
The cast scan that found these hits (
casts.mjsfrom planning TASK-0017), run atd59937feand on this branch:d59937fe) as Promise<…>castsroutes/embeddings/[id].tsxThe 6 that remain are the known non-copies: anonymous object types in
CleanupDetail.tsxandpathways/layout.ts, and libraryReadableStreams. #361 and #362 remove the otheras Promisecasts.Nothing references the removed names any more:
Checks on this branch:
pnpm type-checkpassed,pnpm lintpassed (exit 0, warnings only, all from before), andpnpm testpassed (924 passed, 86 skipped).E2E against an isolated audit DB ran
route-hydration-smoke,homepageandcanvas-note-panel. 20 passed and 4 were skipped./canvas,/embeddings,/aiand/umapall hydrate without errors. 2 tests failed in the parallel run:/docs/new hydratesandrecent list follows edits. This PR does not touch either page. Both passed 4 of 4 with--workers 1 --repeat-each 2, on this branch and on #362's branch.Limits
scanRelativeImagesandprocessPathRoundstill return other fields the client does not read (ok,total,init,extend). They were not in the measured set.Stack: cleanup batches, layer 3 of 3
This slice: the fixes from the data-flow measurement (planning TASK-0017 W8.5).
Why it is its own layer: It edits
routes/embeddings/[id].tsxand the AI query modules after #362's changes there, so it stacks on #362 instead of conflicting with it.Full story: #361
🤖 Generated with Claude Code