You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
enhancement: Add query length guard in handle_chat #83
handle_chat accepts any length query and passes it directly to Gemini with no cap. Pasting a full paper or very long text will hit token limits and return a cryptic error.
Fix
Add a simple guard at the top of handle_chat:
MAX_QUERY_LENGTH=int(os.getenv("MAX_QUERY_LENGTH", "2000"))
iflen(query) >MAX_QUERY_LENGTH:
returnf"Query too long ({len(query)} chars). Please keep it under {MAX_QUERY_LENGTH} characters."
Activity
pragati-0208 commentedon Mar 13, 2026
hello,
I’d like to work on this issue. Could you please assign it to me?