-
Notifications
You must be signed in to change notification settings - Fork 113
Description
name: 🐛 Bug Report
about: Create a report to help us improve FireForm.
title: "[BUG]: Ollama request path lacks timeout and robust error handling"
labels: bug
assignees: @Aryama-srivastav
⚡️ Describe the Bug
The Ollama call path in backend.py (textToJSON.main_loop) performs requests.post(...) without a timeout and assumes a successful HTTP/JSON response with a response key.
If Ollama is slow, unavailable, returns non-200, or returns malformed JSON, FireForm can hang or fail with unclear exceptions.
👣 Steps to Reproduce
Start FireForm with OLLAMA_HOST pointing to an unavailable endpoint (or stop the Ollama container after startup).
Trigger the PDF fill flow (run_pdf_fill_process(...)).
Observe that the process hangs or crashes with a low-context network/JSON error.
Repeat with a mock endpoint returning HTTP 500 / invalid JSON and see unhandled/unclear failure behavior.
📉 Expected Behavior
Requests to Ollama should fail fast with a bounded timeout.
HTTP errors should be surfaced with clear context (field name + endpoint failure).
Invalid/malformed JSON payloads should return explicit parsing errors.
Missing response key should produce a meaningful exception instead of generic failure.
🖥️ Environment Information
OS: (e.g. Ubuntu 22.04, macOS M2, Windows 11)
Docker/Compose Version: (output of docker --version and docker compose version)
Ollama Model used: (e.g. mistral / Mistral-7B)