Skip to content

Commit e7ac707

Browse files
davindicodeclaude
andcommitted
Fix ipynb/JSON file reading, bump size limit to 10MB
- Added +json and +xml MIME type matching (covers .ipynb = application/x-ipynb+json) - Bumped non-text file read limit from 2MB to 10MB - Text-detected files always read regardless of size Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 54a4397 commit e7ac707

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/routes/api/files.read.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ export async function loader({ request }: Route.LoaderArgs) {
1616
const isText =
1717
mimeType.startsWith("text/") ||
1818
mimeType === "application/json" ||
19+
mimeType.includes("+json") ||
1920
mimeType === "application/javascript" ||
2021
mimeType === "application/typescript" ||
2122
mimeType === "application/xml" ||
23+
mimeType.includes("+xml") ||
2224
mimeType.includes("yaml") ||
2325
mimeType.includes("toml");
2426

25-
if (isText || stats.size < 2 * 1024 * 1024) {
27+
if (isText || stats.size < 10 * 1024 * 1024) {
2628
const content = await readFile(filePath, "utf-8");
2729
return Response.json({ path: filePath, content, mimeType, size: stats.size });
2830
}

0 commit comments

Comments
 (0)