[BUG] Native Gemini provider ignores timeout, so requests never time out

オープン
#9,741 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@abhishekacharya200 がすでに取り組んでいます。

2026年11月24日 から。

  • #9738 @abhishekacharya200 による — マージされずにクローズ
  • #9742 @abhishekacharya200 による — オープン
  • #9748 @Mansi2221 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
google-cloud, python
領域
ai

調査の方向性

Start in crewai/llms/providers/gemini/completion.py: inspect GeminiCompletion, how BaseLLM moves timeout into additional_params, and where genai.Client is built with http_options. Check the linked PRs #9742 and #9748 before writing anything, since work is already under way. Done means http_options.timeout is set in milliseconds for call() and acall(), to_config_dict() keeps timeout, and the reproduction from the issue plus provider tests pass.

索引モデルが issue の本文から書いたものです。

説明

Description

LLM(model="gemini/...", timeout=120) builds a GeminiCompletion, but the timeout is never passed to the Google Gen AI client. GeminiCompletion has no timeout field, so BaseLLM moves the value into additional_params, and the Gemini provider never reads additional_params. The client is created with no http_options.timeout, so a slow or stuck request waits forever.

The LLM docs use a Gemini model as the example for timeout=120, and the OpenAI and Anthropic providers both honor it.

Steps to Reproduce
from unittest.mock import patch
from crewai import LLM

with patch("crewai.llms.providers.gemini.completion.genai") as genai:
    llm = LLM(model="gemini/gemini-2.0-flash-001", api_key="x", timeout=30)
    print(type(llm).__name__)              # GeminiCompletion
    print(genai.Client.call_args.kwargs)   # no http_options
    print(llm.additional_params)           # {'timeout': 30}
Expected behavior

The client is built with http_options.timeout=30000 (the SDK takes milliseconds), and to_config_dict() keeps timeout.

Actual behavior

The timeout is silently dropped. Calls through call() and acall() have no client side timeout.

Possible Solution

Add a timeout field to GeminiCompletion and merge it into client_params["http_options"] when building genai.Client. In Vertex AI Express mode, merge api_version="v1" into the same options instead of replacing them.

Note for maintainers: this was prepared with help from an AI coding agent and checked by me, so per CONTRIBUTING please add the llm-generated label (I don't have permission to add labels).

主要言語
Python
スター
61.2k
フォーク
9.2k
平均マージ
1日 14時間
マージ済み PR(30日)
180

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

crewAIInc/crewAI のほかの issue

crewAIInc/crewAI の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。