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
route_query() constructs RelevantSection objects from raw router output without catching pydantic.ValidationError. If the router module returns a section with page_start > page_end or a section_id not matching ^sec_[A-Za-z0-9]+$, the Pydantic model validator raises ValidationError — caught only by the global 500 handler, producing a response with no query_id and no way to correlate the error to the failing request.
Root Cause
backend/app/api/routing.py around lines 119–135:
sections= [
RelevantSection( # ← ValidationError if section_id pattern failssection_id=s.section_id,
page_start=s.page_start, # ← _page_range_valid raises if start > endpage_end=s.page_end,
...
)
forsindecision.relevant_sections
]
# query_id is assigned AFTER this loop:query_id=str(uuid4()) # ← never reached if ValidationError is raised abovereturnRouteResponse(query_id=query_id, ...)
The 500 response has no query_id field, so operators cannot correlate the server-side log with the client's error report.
Failure Scenario
A router module bug returns page_start=10, page_end=5 for a section.
Activity
piyushmakhija28 commentedon Jun 21, 2026
Fixed in PR #280 (Sprint R3/R4: fix(sprint-r3): root-cause fixes for all 39 bugs from code review round 3 + Sprint R4 round 4)