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

@m86hussein m86hussein commented Nov 8, 2026 •

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

AI disclosure: this PR was drafted with GitHub Copilot and opened by @m86hussein, who is responsible for it.

@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).

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>
@m86hussein
m86hussein force-pushed the fix/8287-chatgpt-timeout branch from 9e69e97 to 8e01e67 Compare November 22, 2026 16:07
@m86hussein

Copy link
Copy Markdown
Author

Rebased onto the latest master (still a single signed-off commit). @pingsutw, could you take a look when you have a moment? This makes the ChatGPT connector honor chatgpt_config["timeout"] instead of the hard-coded 10 s (flyteorg/flyte#8287). Thanks!

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