Skip to content

Bug: frontend integration requests can hang without POST timeouts #148

Description

@eshaanag

While checking the frontend-integration example, I noticed the request timeout handling is inconsistent.

In frontend-integration/frontend_app.py, the /health route calls each agent with requests.get(..., timeout=5) at line 114, but the user-facing routes call local agents without a timeout:

  • search_products() uses requests.post(f"{AGENTS['search']}/search", json=payload) around line 27
  • get_product_info() uses requests.post(f"{AGENTS['info']}/product", json=payload) around line 68

If either local agent accepts the connection but stalls, the Flask request can hang until the HTTP client/socket stack gives up. That makes the frontend feel stuck instead of returning the same kind of controlled error response already used for offline agents.

Suggested fix:

  • add explicit timeouts to both POST requests, probably matching the existing health check timeout
  • keep the existing requests.RequestException handling so timeout failures return JSON errors instead of blocking the request
  • optionally document the timeout behavior in the frontend integration README

This should stay scoped to frontend-integration/frontend_app.py and the related README if maintainers want the behavior documented.

If this looks valid for GSSoC'26, I can work on a focused fix for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions