a2aproject / a2aproject/a2a-samples
Errors when setting @click.option("--use_push_notifications", default=True)
- Linguagem predominante
- Jupyter Notebook
- Estrelas
- 1.8k
- Forks
- 751
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
When running the CLI and changing line 13 from @click.option("--use_push_notifications", default=False) to @click.option("--use_push_notifications", default=True) I would expect this to work.
The follow errors occur:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "C:\Users\rickcau\source\repos\A2A\samples\python\hosts\cli\__main__.py", line 115, in
asyncio.run(cli())
~~~^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\asyncclick\core.py", line 1211, in __call__
return anyio.run(self._main, main, args, kwargs, **opts)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\anyio\_core\_eventloop.py", line 74, in run
return async_backend.run(func, args, {}, backend_options)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\anyio\_backends\_asyncio.py", line 2310, in run
return runner.run(wrapper())
~~~~~~~~~~^^^^^^^^^^^
File "C:\Users\rickcau\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\rickcau\AppData\Roaming\uv\python\cpython-3.13.3-windows-x86_64-none\Lib\asyncio\base_events.py", line 719, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\anyio\_backends\_asyncio.py", line 2298, in wrapper
return await func(*args)
^^^^^^^^^^^^^^^^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\asyncclick\core.py", line 1214, in _main
return await main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\asyncclick\core.py", line 1126, in main
rv = await self.invoke(ctx)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\asyncclick\core.py", line 1496, in invoke
return await ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\.venv\Lib\site-packages\asyncclick\core.py", line 829, in invoke
rv = await rv
^^^^^^^^
File "C:\Users\rickcau\source\repos\A2A\samples\python\hosts\cli\__main__.py", line 27, in cli
from .push_notification_listener import PushNotificationListener
ImportError: attempted relative import with no known parent package
Guia de contribuição
Direção de pesquisa
The error occurs in hosts/cli/__main__.py at line 27 when trying to import PushNotificationListener. Start by examining the relative import structure and the condition that triggers this import. Check how the --use_push_notifications flag is handled and ensure the module path is correct when the flag is True. Run the CLI with the flag set to True to reproduce the error and verify the fix.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- cli
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 65/100