Skip to content

Make ChatGPT connector timeout configurable - #3487

Open
m86hussein wants to merge 1 commit into
flyteorg:masterfrom
m86hussein:fix/8287-chatgpt-timeout
Open

m86hussein wants to merge 1 commit into
flyteorg:masterfrom
m86hussein:fix/8287-chatgpt-timeout

Conversation

@m86hussein

Copy link
Copy Markdown

Why

The ChatGPT connector wrapped the completion call in asyncio.wait_for(...) with a hard-coded 10s timeout (TIMEOUT_SECONDS). Long-running completions (e.g. reasoning models) therefore failed with TimeoutError even when a caller passed a timeout in chatgpt_config — that value only reached the OpenAI SDK, not the wait_for guard.

What

  • Read the timeout from chatgpt_config.get("timeout", TIMEOUT_SECONDS) so the wait_for guard and the OpenAI request use the same value.
  • Default behavior is unchanged (10s) when no timeout is set.
  • Added a parametrized regression test asserting wait_for receives the configured timeout (and the 10s default otherwise).

Related issue

Fixes flyteorg/flyte#8287

The ChatGPT connector wrapped the completion call in asyncio.wait_for with a hard-coded 10s timeout, so long-running completions (e.g. reasoning models) failed with TimeoutError even when callers set a timeout in chatgpt_config. Read the timeout from chatgpt_config (defaulting to TIMEOUT_SECONDS) so the wait_for guard and the OpenAI request agree.

Fixes flyteorg/flyte#8287

Signed-off-by: m86hussein <m86hussein@gmail.com>
@welcome

welcome Bot commented Nov 8, 2026

Copy link
Copy Markdown

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

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.

[flytekit] ChatGPT connector times out after a hard-coded 10 s regardless of chatgpt_config["timeout"]

1 participant