Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

agentdev run recurses while patching ResponsesHostServer with current Agent Framework hosting

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

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

まだ誰も着手していません。

評価

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

調査の方向性

Start by locating _PatchingFinder.find_spec and _patch_foundry_hosting_module in the agentdev import hook, then trace how _patched is set around the patch call. Reproduce with the listed Python and Agent Framework versions using the provided agentdev run command. Done means the hosting patch completes without recursive import failure and the agent server starts on port 8088.

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

説明

needs attention

Bug description

agentdev run crashes with a RecursionError before the hosted agent starts when used with the current agent-framework-foundry-hosting package. The recursion occurs in agentdev's import hook while it tries to patch ResponsesHostServer; the hosting package resolves that attribute lazily, and the resulting submodule import re-enters the same hook.

Environment

  • OS: Windows 11
  • Python: 3.11
  • agent-dev-cli==0.0.1b260427 (latest available when tested)
  • agent-framework-core==1.19.0
  • agent-framework-foundry==1.13.1
  • agent-framework-foundry-hosting==1.0.0b260918
  • azure-ai-agentserver-responses==2.2.0

The agent framework versions are pinned by the application. agent-dev-cli==0.0.1b260427 declares agent-framework-core>=1.1.1,<1.3.0, which conflicts with core 1.19.0. A normal pip install proposes downgrading core to 1.2.2, so the CLI was installed with --no-deps to preserve the application's pinned dependencies. Its websockets>=13.0 dependency was installed separately.

Steps to reproduce

  1. Create a Python 3.11 virtual environment.

  2. Install the versions listed above, then install agent-dev-cli==0.0.1b260427 with --no-deps (and its websockets>=13.0 dependency).

  3. Use an agent entrypoint that imports AgentSessionStoreProvider and ResponsesHostServer from agent_framework_foundry_hosting and hosts the agent with ResponsesHostServer.run_async().

  4. From the directory containing main.py, run:

    python -m agentdev run main.py --port 8088 --verbose

Actual result

The agentdev bootstrap reports that import hooks were installed, then startup fails with RecursionError during imports. The repeated call path is:

_PatchingFinder.find_spec → _check_and_patch → _patch_foundry_hosting_module → hasattr(module, ResponsesHostServer) → agent_framework_foundry_hosting.__getattr__ → importlib.import_module → _PatchingFinder.find_spec again.

In the tested hook, _patched is set only after the patch function returns, so it does not prevent this re-entrant call. The process exits before binding port 8088; readiness/health endpoints are unavailable.

Expected result

agentdev run should complete the hosting patch and start the agent server on the requested port without recursive import failure.

Additional context

Running the entrypoint without agentdev does not produce this recursion. The standalone process completes imports (about 9 seconds on a warm run, about 30 seconds on a cold run) and proceeds to agent initialization. This isolates the reported RecursionError to agentdev's patch/import-hook path. The local standalone run later encountered separate Azure CLI credential expiration, unrelated to this issue.

A possible fix is to establish a re-entrancy guard before calling the patch routine, or avoid attribute access that invokes module-level __getattr__ while inspecting the hosting module.

主要言語
JavaScript
スター
2.1k
フォーク
262
平均マージ
17時間 25分
マージ済み PR(30日)
28

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

microsoft/foundry-dev-tools のほかの issue

microsoft/foundry-dev-tools の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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