Skip to content

Wikidata components should use bounded HTTP timeouts #13655

Description

@luochen211

Bug Description

Both Wikidata components call the public Wikidata API without an explicit timeout:

# src/lfx/src/lfx/components/tools/wikidata_api.py
response = httpx.get(self.wikidata_api_url, params=params)

# src/lfx/src/lfx/components/wikipedia/wikidata.py
response = httpx.get(wikidata_api_url, params=params)

When Wikidata is slow or unreachable, a flow that invokes the component/tool can block longer than expected instead of returning a bounded tool/component error.

Reproduction

  1. Add the Wikidata component/tool to a flow.
  2. Run the flow in an environment where https://www.wikidata.org/w/api.php is slow, blocked, or blackholed.
  3. The component waits on httpx.get() without a configured timeout.

Minimal code path:

from lfx.components.wikipedia.wikidata import WikidataComponent

component = WikidataComponent(query="Langflow")
component.fetch_content()

Expected behavior

Wikidata requests should use a bounded timeout and return a clear ToolException/component error when the external API is unavailable.

Environment

  • Operating System: Linux/macOS
  • Langflow Version: current main branch by code inspection
  • Python Version: 3.11/3.12

Metadata

Metadata

Assignees

No one assigned

    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