Skip to content

Bug: Flask jsonify() left behind in FastAPI migration crashes chat on no-result queries #7

Description

@anushagarg6

Description

After the Flask → FastAPI migration, the /api/chat route still calls jsonify() in the null-result branch. jsonify is a Flask function that does not exist in FastAPI.

Impact

Any question that returns no retrieval results from ChromaDB triggers an uncaught NameError: name 'jsonify' is not defined, returning a 500 Internal Server Error instead of a graceful fallback answer.

Location

backend/app.py — inside the /api/chat route, null-result branch.

Fix Applied (commit 2936cb5)

Replaced return jsonify(chat_response(...)) with a plain return chat_response(...), which FastAPI serializes to JSON automatically.

Labels

bug, backend

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions