Skip to content

fix: harden backend validation, parsing, and 404 handling - #165

Open
ANIRUDDH-001 wants to merge 1 commit into
c2siorg:mainfrom
ANIRUDDH-001:feat/issue-161-backend-stability-hardening
Open

fix: harden backend validation, parsing, and 404 handling#165
ANIRUDDH-001 wants to merge 1 commit into
c2siorg:mainfrom
ANIRUDDH-001:feat/issue-161-backend-stability-hardening

Conversation

@ANIRUDDH-001

Copy link
Copy Markdown

Summary

Hardens b0bot backend stability by fixing critical issues in route validation, error handling, and LLM response parsing.

What Changed

  • Routes: Added validation guards for missing/blank keyword parameters (returns 400)
  • 404 Handler: Fixed response flow with explicit return statement
  • Parser: Hardened toJSON() against None/empty/whitespace inputs and malformed lines

Why

Resolves Issue #161 and prevents IndexError crashes when users submit empty requests or the LLM returns malformed data.

Testing

  • 5 route tests: keyword validation (missing/blank) + 404 responses
  • 5 parser tests: None/empty/whitespace/malformed/single-item handling
  • All 13 tests passing locally

Related

Closes c2siorg#161

Assisted-By: GitHub Copilot (GPT-5.3-Codex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve backend stability by fixing LLM parsing, API validation, and 404 error handling

1 participant