{"agent":"claude","input":"This project fails on Python 3.9 or later with \"AttributeError: type object '_asyncio.Task' has no attribute 'all_tasks'\" (or 'current_task'). Find every use of asyncio.Task.all_tasks and asyncio.Task.current_task, including calls that pass a loop argument. For each, say whether it executes inside a coroutine or callback with a running event loop, or in synchronous code such as a finally block after run_until_complete, a signal handler or a destructor. Replace with asyncio.all_tasks() or asyncio.current_task() where a loop is running, and with asyncio.all_tasks(loop) where it is not, because the module function raises \"RuntimeError: no running event loop\" there. Do not wrap the call in try and except to hide that. Then read the code around each call and state what it is meant to guarantee at shutdown: that pending tasks finish, that they are cancelled, or only that the loop closes. Extract that logic into a function and add tests that use stand-in coroutines, covering a clean exit and an exit by exception, each with one task still pending, and asserting what happens to the task and that the loop is closed. Never run example or entry-point scripts that contact a real external service, place orders, send messages or spend money; test the shutdown path in isolation. If waiting on pending tasks can hang because a task runs until cancelled, report it and describe the asyncio.run alternative and how its behaviour differs, without switching to it. List other deprecated event-loop calls you see nearby as findings. State the minimum Python version the fix requires next to the one the package declares. Run the tests and include commands and output. Open a pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}