Skip to content

Conversation

@ultmaster
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 16, 2026 09:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR performs maintenance tasks on the codebase, including adding a new Azure OpenAI cleanup script, adding defensive null checks to MongoDB operations, implementing stub methods for experimental Weave annotation queue APIs, and refactoring async function detection logic.

Changes:

  • Added a new utility script cleanup_aoai.py for deleting Azure OpenAI fine-tuning jobs and data files
  • Added a null check in MongoDB upsert operation to satisfy type checkers
  • Implemented stub methods for experimental Weave annotation queue APIs
  • Refactored async function detection to include additional asyncio.iscoroutinefunction checks

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
scripts/cleanup_aoai.py New utility script for cleaning up Azure OpenAI resources (fine-tuning jobs and files)
agentlightning/store/collection/mongo.py Added defensive null check in upsert operation with pyright ignore comment
agentlightning/instrumentation/weave.py Added stub implementations for experimental Weave annotation queue API methods
agentlightning/emitter/reward.py Refactored async function detection to include hasattr check for asyncio.iscoroutinefunction
agentlightning/emitter/annotation.py Refactored async function detection to include hasattr check for asyncio.iscoroutinefunction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 95 to 97
is_async = inspect.iscoroutinefunction(fn) or (
hasattr(asyncio, "iscoroutinefunction") and asyncio.iscoroutinefunction(fn) # type: ignore
)
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for asyncio.iscoroutinefunction is redundant and potentially confusing. The inspect.iscoroutinefunction function already handles all coroutine function detection including those decorated with asyncio.coroutine. The hasattr check and additional asyncio.iscoroutinefunction call are unnecessary since inspect.iscoroutinefunction is the standard and complete way to detect coroutine functions. Consider simplifying to just use inspect.iscoroutinefunction.

Suggested change
is_async = inspect.iscoroutinefunction(fn) or (
hasattr(asyncio, "iscoroutinefunction") and asyncio.iscoroutinefunction(fn) # type: ignore
)
is_async = inspect.iscoroutinefunction(fn)

Copilot uses AI. Check for mistakes.
Comment on lines 249 to 251
if inspect.iscoroutinefunction(fn) or (
hasattr(asyncio, "iscoroutinefunction") and asyncio.iscoroutinefunction(fn) # type: ignore
):
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for asyncio.iscoroutinefunction is redundant and potentially confusing. The inspect.iscoroutinefunction function already handles all coroutine function detection including those decorated with asyncio.coroutine. The hasattr check and additional asyncio.iscoroutinefunction call are unnecessary since inspect.iscoroutinefunction is the standard and complete way to detect coroutine functions. Consider simplifying to just use inspect.iscoroutinefunction.

Suggested change
if inspect.iscoroutinefunction(fn) or (
hasattr(asyncio, "iscoroutinefunction") and asyncio.iscoroutinefunction(fn) # type: ignore
):
if inspect.iscoroutinefunction(fn):

Copilot uses AI. Check for mistakes.
@ultmaster
Copy link
Contributor Author

/ci

@github-actions
Copy link

github-actions bot commented Jan 16, 2026

🚀 CI Watcher for correlation id-3759124194-mkgpbbzj triggered by comment 3759124194
🏃‍♀️ Tracking 2 workflow run(s):

✅ All runs completed.

@ultmaster ultmaster changed the title Pipeline maintainance Pipeline maintainence Jan 19, 2026
@ultmaster ultmaster merged commit 5f3093d into main Jan 19, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants