agentdev run recurses while patching ResponsesHostServer with current Agent Framework hosting
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 66/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.0agent-framework-foundry==1.13.1agent-framework-foundry-hosting==1.0.0b260918azure-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
-
Create a Python 3.11 virtual environment.
-
Install the versions listed above, then install
agent-dev-cli==0.0.1b260427with--no-deps(and itswebsockets>=13.0dependency). -
Use an agent entrypoint that imports
AgentSessionStoreProviderandResponsesHostServerfromagent_framework_foundry_hostingand hosts the agent withResponsesHostServer.run_async(). -
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 2.1k
- Forks
- 262
- Merge medio
- 17 h 25 min
- PR fusionados (30 d)
- 28
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/foundry-dev-tools
-
FoundryXAbiertoneeds attention
Dificultad 1/5 Menos de una hora Aptitud para principiantes 20/100
microsoft/foundry-dev-tools#901 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
error while deploying modelAbiertoneeds attention
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/foundry-dev-tools#899 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs attention
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/foundry-dev-tools#896 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs attention
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
microsoft/foundry-dev-tools#895 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs attention
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
microsoft/foundry-dev-tools#894 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/foundry-dev-tools
Issues similares
-
frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
uoftblueprint/canada-basketball#79 ·
Los mantenedores suelen responder en 1 día
-
New App Request
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
ThatGuySam/doesitarm#1126 · 1 comentario ·
-
[Feature]: 建议导入源后,自动切换到新导入的源Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
lyswhut/lx-music-desktop#3026 ·
-
good first issue server
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
openstreetmap/iD#13054 ·
Los mantenedores suelen responder en 1 día