Skip to content

Feature Request: Configurable API Timeout #97

@johnib

Description

@johnib

Problem

The current hardcoded timeout causes inference operations to fail when they exceed ~30 seconds. Complex prompts, large context windows regularly take 30-60+ seconds to complete, but the proxy times out before GitHub Copilot can return a successful response.

Impact

  • Failed requests for legitimate long-running operations
  • Particularly problematic with Claude Code for complex coding tasks
  • Multi-step reasoning and large file analysis operations commonly exceed 34+ seconds
  • Users lose work and have to retry requests multiple times

Proposed Solution

Add a configurable --timeout flag that allows users to set API timeouts in milliseconds:

  copilot-api start --timeout 120000  # 2 minutes

Benefits

  • Prevents legitimate long-running operations from failing
  • Maintains reasonable timeout protection against truly hung requests
  • Higher default timeout (e.g., 2 minutes) improves reliability out-of-the-box
  • Users can customize based on their specific use cases

Implementation

Add timeout parameter to CLI options and implement AbortController-based timeout handling across all API calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions