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

Open Beginner friendly
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
Jupyter Notebook
Stars
1.8k
Forks
759
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from a2aproject/a2a-samples

All issues in a2aproject/a2a-samples

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.