a2aproject / a2aproject/a2a-samples

Errors when setting @click.option("--use_push_notifications", default=True)

未關閉 適合新手
#41 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Jupyter Notebook
星號
1.8k
分支
751
PR 合併指標
30 天內沒有已合併 PR

描述

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

貢獻指南

開啟貢獻指南

研究方向

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.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
65/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。