Skip to content

Commit d784769

Browse files
alfarahnCopilot
andcommitted
feat: suppress warnings in JSON output and enhance upload endpoint metadata for file size limits
Co-authored-by: Copilot <copilot@github.com>
1 parent ebdd570 commit d784769

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/Dashboard/AI/Tools/Resources/file_inspect.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@
2929
import os
3030
import sys
3131
import traceback
32+
import warnings
3233
from typing import Any
3334

35+
# stdout MUST be pure JSON — route every warning to stderr so a stray
36+
# pandas/pyarrow DeprecationWarning can't corrupt the response.
37+
warnings.simplefilter("ignore")
38+
warnings.showwarning = lambda *a, **kw: None
39+
3440
# Hard caps — these protect the LLM context window
3541
MAX_ROWS_PER_CALL = 200
3642
MAX_TEXT_CHARS_PER_CALL = 8000

src/Dashboard/Web/UploadEndpoints.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public static void MapUploadEndpoints(this IEndpointRouteBuilder app)
7676
}
7777

7878
return Results.Ok(new { files = results });
79-
}).DisableAntiforgery();
79+
})
80+
.DisableAntiforgery()
81+
.WithMetadata(new Microsoft.AspNetCore.Mvc.RequestSizeLimitAttribute(MaxBytes + 10L * 1024 * 1024)); // file cap + multipart overhead
8082

8183
app.MapGet("/api/uploads", (HttpContext ctx) =>
8284
{

0 commit comments

Comments
 (0)