Remove unused fileData code in financial-data-analyst route.ts#365
Open
LuciferDono wants to merge 1 commit into
Open
Remove unused fileData code in financial-data-analyst route.ts#365LuciferDono wants to merge 1 commit into
LuciferDono wants to merge 1 commit into
Conversation
The frontend sends only { messages, model } to /api/finance. The fileData
handling block (lines 137-193), isValidBase64 helper, and related log
fields were unreachable dead code left from a prior refactor.
Fixes anthropics#234
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
financial-data-analyst/app/api/finance/route.tsAPI route contains dead code for handlingfileDatathat is never sent by the frontend. The frontend (page.tsx) constructs{ messages, model }and sends it to/api/finance—fileDatais never included in the request body.Fixes #234.
Root Cause
The
fileDatahandling appears to be a vestige of a prior refactor. The frontend now constructs the full message content (including file attachments) client-side viaapiMessagesinpage.tsxbefore sending to the API route. The backend's file processing code is unreachable.Changes
Removed from
route.ts:isValidBase64helper function (defined but never called)fileDatafrom request body destructuringfileData-related fields from the initial request logfileDatahandling block (~57 lines of dead code for text/image file processing)let anthropicMessagestoconstsince it is no longer reassignedNet: 72 lines removed, 2 lines changed. Zero behavior change.
Verification
page.tsxsends{ messages: apiMessages, model: selectedModel }only (line 434-437)fileDatain the context of the finance API routeisValidBase64had zero call sites