-
Notifications
You must be signed in to change notification settings - Fork 6
fix: supervisor identity matching — prefer GitHub username, fuzzy compare #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pare get_aidevops_identity() now prefers the GitHub username (via gh api user, cached per session) over user@host format. This matches how TODO.md assignees are typically written (e.g., assignee:marcusquinn). check_task_claimed() now does fuzzy matching: compares against the full identity, the username portion (before @), the local whoami, and the GitHub username. This prevents the supervisor from skipping its own tasks when assignee format doesn't exactly match identity format. cmd_claim() and cmd_unclaim() now delegate to check_task_claimed() for consistent matching instead of duplicating comparison logic.
|
Caution Review failedThe pull request is closed. WalkthroughThis PR refines identity resolution and task-claim validation in the supervisor helper script by introducing GitHub username-based identity caching and replacing direct string equality checks with fuzzy matching. This normalizes different identity representations (user, user@host, GitHub username) for consistent claim/unclaim behavior. TODO.md updated with blocking status. Changes
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly Related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where the supervisor system failed to correctly recognize task ownership due to rigid identity matching. By introducing a preference for GitHub usernames in identity retrieval and implementing fuzzy comparison logic for task assignees, the system can now accurately determine if a task is claimed by the current user, regardless of the identity format used in the task assignment. This significantly improves the reliability of task dispatch and claiming operations. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sun Feb 8 18:18:50 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a more robust identity matching system for task claiming. It correctly prioritizes the GitHub username for identity, falls back gracefully, and implements fuzzy matching to handle discrepancies between different identity formats (e.g., username vs. user@host). The refactoring of cmd_claim and cmd_unclaim to use the new centralized check_task_claimed function is a good improvement for code consistency and maintainability. I've found one high-severity issue with the new fuzzy matching logic that could cause it to fail in certain scenarios, for which I've provided a suggested fix.
| local gh_user="${_CACHED_GH_USERNAME:-}" | ||
| local identity_user="${identity%%@*}" # Strip @host portion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fuzzy matching logic may not work as expected if the AIDEVOPS_IDENTITY environment variable is set. In that scenario, get_aidevops_identity() returns early, and the _CACHED_GH_USERNAME variable is never populated. Consequently, the check against gh_user inside check_task_claimed() will always fail unless the assignee is an empty string.
To ensure fuzzy matching against the GitHub username works reliably in all cases, the GitHub username should be fetched within this function if it hasn't been cached already.
| local gh_user="${_CACHED_GH_USERNAME:-}" | |
| local identity_user="${identity%%@*}" # Strip @host portion | |
| # Ensure GitHub username is cached for fuzzy matching, even if AIDEVOPS_IDENTITY is set. | |
| if [[ -z "${_CACHED_GH_USERNAME:-}" ]]; then | |
| _CACHED_GH_USERNAME=$(gh api user --jq '.login' 2>/dev/null || echo "") | |
| fi | |
| local gh_user="${_CACHED_GH_USERNAME:-}" | |
| local identity_user="${identity%%@*}" # Strip @host portion |



Summary
get_aidevops_identity()now prefers GitHub username (viagh api user, cached per session) overuser@hostformatcheck_task_claimed()now does fuzzy matching: compares against full identity, username portion (before@), localwhoami, and GitHub usernamecmd_claim()andcmd_unclaim()delegate tocheck_task_claimed()for consistent matchingRoot Cause
The supervisor was skipping t166 and t167 during dispatch because:
assignee:marcusquinn(GitHub username, set manually)get_aidevops_identity()returnedmarcusquinn@Marcus-MacBook-Pro(user@host)This is a single-user system where the repo owner, the GitHub user, and the supervisor are all the same person. The identity system needs to recognize that.
Changes
get_aidevops_identity()user@hostuser@hostcheck_task_claimed()cmd_claim()check_task_claimed()cmd_unclaim()check_task_claimed()Testing
_CACHED_GH_USERNAMEto avoid repeated API callsghis unavailable (usesuser@host)Summary by CodeRabbit
Release Notes
Bug Fixes
Chores