Skip to content

fix(llm): add default 60s timeout to prevent hanging LLM API calls#7424

Open
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:fix/default-timeout-60s
Open

fix(llm): add default 60s timeout to prevent hanging LLM API calls#7424
Jah-yee wants to merge 1 commit intomicrosoft:mainfrom
Jah-yee:fix/default-timeout-60s

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 18, 2026

Summary

Adds default 60-second timeout to OpenAI client API calls to prevent indefinite hangs on network issues.

Problem

Currently, autogen creates OpenAI client API calls without a default timeout, which can cause:

  • Multi-agent workflows stuck waiting forever on network issues
  • No way to recover from transient network failures

Solution

Add a default timeout of 60 seconds in _create_args_from_config() when no timeout is explicitly provided by the user.

Changes

  • Modified _create_args_from_config() in python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py
  • Added 3 lines to check if timeout is not provided and set default to 60.0 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant