[Agent Engines] `_wrap_async_stream_query_operation` blocks asyncio event loop due to synchronous gRPC iteration
メンテナーはふだん 1 日以内に返信
@maxgasztych がすでに取り組んでいます。
2026年9月18日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
調査の方向性
vertexai/agent_engines/_agent_engines.py の _wrap_async_stream_query_operation から始め、execution_api_client の同期呼び出しと self.execution_async_client を比較します。asyncio.run(..., debug=True) でストリームを再現します。async_stream_query がソケットの読み取り中にイベントループのスレッドをブロックせず、それでも解析済みチャンクを生成し続ければ完了です。
索引モデルが issue の本文から書いたものです。
説明
agent_engine.async_stream_query(...) blocks the calling asyncio event loop thread during stream generation.
In vertexai/agent_engines/_agent_engines.py, _wrap_async_stream_query_operation wraps a synchronous client call in an async def and uses a blocking for loop:
# CURRENT IMPLEMENTATION (vertexai/agent_engines/_agent_engines.py)
def _wrap_async_stream_query_operation(*, method_name: str):
async def _method(self, **kwargs):
# 1. Uses sync client instead of self.execution_async_client
response = self.execution_api_client.stream_query_reasoning_engine(...)
# 2. Synchronous iteration blocks the asyncio event loop on socket reads
for chunk in response:
for parsed_json in _utils.yield_parsed_json(chunk):
if parsed_json is not None:
yield parsed_json
return _method
Reproduction:
import asyncio
from vertexai import agent_engines
agent = agent_engines.get("projects/<P>/locations/<L>/reasoningEngines/<ID>")
async def main():
async for chunk in agent.async_stream_query(user_id="u", message="Long prompt"):
pass
asyncio.run(main(), debug=True)
# Result: Emits "Executing <Task ...> took X.XX seconds" because the thread is blocked on socket reads without yielding.
- 主要言語
- Python
- スター
- 908
- フォーク
- 468
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/python-aiplatform のほかの issue
-
Protobuf 7.35.1+ support対応中かも @garethknowles が 25 日前に担当しました。 オープンapi: vertex-ai
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
googleapis/python-aiplatform#7132 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
AgentEngineConfig.agent_framework Literal rejects "a2a" — out of sync with _SUPPORTED_AGENT_FRAMEWORKS and the GA A2A template再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンapi: vertex-ai
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/python-aiplatform#7097 ·
メンテナーはふだん 1 日以内に返信
-
CustomContainerTrainingJob.run drops max_wait_duration=0 instead of requesting indefinite DWS wait対応中かも @hugosmoreira が 52 日前に担当しました。 オープンapi: vertex-ai
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/python-aiplatform#7067 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
`A2aAgent` builds agent-card `url` from default region (us-central1), ignoring `GOOGLE_CLOUD_AGENT_ENGINE_LOCATION`対応中かも @sushicw が 115 日前に担当しました。 オープンapi: vertex-ai
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
googleapis/python-aiplatform#6877 ·
メンテナーはふだん 1 日以内に返信
-
api: vertex-ai
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
googleapis/python-aiplatform#6865 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
googleapis/python-aiplatform の issue をすべて見る
似ている issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
debpalash/VoiceStudio#2624 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Make Catch2 optional when `RDK_BUILD_CPP_TESTS=OFF`対応中かも @pechersky が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
There are a few redundant calls to `fdesc._setCloseOnExec()`対応中かも @gudnimg が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信