Skip to content

bug: http_request tool has no request timeout #442

@Ratansairohith

Description

@Ratansairohith

Description

The http_request tool calls session.request(**request_kwargs) at line 884 without a timeout parameter. The Python requests library defaults to no timeout, so a non-responsive server will block the agent indefinitely.

The word "timeout" does not appear anywhere in http_request.py. The TOOL_SPEC input schema also has no timeout field.

Reproduction

# Agent calls http_request to a server that hangs
# The tool never returns, the agent is stuck

Suggested fix

  1. Add a default timeout (e.g. 30 seconds) to session.request():
request_kwargs.setdefault("timeout", 30)
response = session.request(**request_kwargs)
  1. Optionally add a timeout parameter to the TOOL_SPEC input schema so the model or user can override it per request.

Happy to submit a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions