Skip to content
This repository was archived by the owner on Sep 29, 2026. It is now read-only.
This repository was archived by the owner on Sep 29, 2026. It is now read-only.

Add configurable timeouts to HTTP client and streaming responses #33

Description

@AnthonyRonning

Problem

The proxy has no timeouts configured anywhere. The OpenSecretClient uses reqwest::Client::new() with no timeout settings, meaning requests and streaming responses can hang indefinitely if the backend stops responding or a connection drops mid-stream.

This affects:

  • Regular chat completions: can hang forever waiting for a response
  • Streaming SSE responses: the stream has no read timeout and no heartbeat timeout, so a dropped connection mid-stream will block indefinitely rather than surfacing an error to the client

Impact

Users running agentic workloads (e.g. via API with tools like OpenClaw) may encounter silent hangs rather than fast failures when connectivity issues occur. This makes it harder to implement retry logic on the client side since the error is never returned.

Proposed Fix

Add a configurable timeout via environment variable (e.g. MAPLE_REQUEST_TIMEOUT_SECS, defaulting to something reasonable like 300s for streaming). Apply it when constructing the reqwest client:

ClientBuilder::new()
    .timeout(Duration::from_secs(timeout_secs))
    .build()?

For streaming specifically, a separate read/idle timeout may also be worth considering to handle cases where the server starts a response but stalls mid-stream.

No activity

Activity on this issue will appear here.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions