Skip to content

Conversation

@YakshithK
Copy link
Contributor

Summary

This PR implements backend sanitization of @OpenHands mentions in GitHub comments to prevent self-mention loops. Instead of mentioning the OpenHands agent, the sanitization inserts a zero-width joiner after the @ symbol, making the mention non-clickable while maintaining readability.

Changes

  • Added sanitize_openhands_mentions() function in openhands/sdk/utils/github.py that uses a zero-width joiner (U+200D) to prevent @OpenHands mentions from being parsed as clickable references
  • Updated GitHub workflow files to sanitize @OpenHands mentions before posting comments
  • Updated example agent script to sanitize review comments before posting
  • Exported the new function from the utils module

Technical Details

  • The sanitization is performed in the backend (when outputting to GitHub comments) rather than at the agent/frontend level
  • Uses regex pattern matching to identify @OpenHands mentions (case-insensitive)
  • Inserts zero-width joiner after @ to break the mention linkage
  • Maintains text readability since the zero-width joiner is invisible

Related PR

See OpenHands/OpenHands#11550 for the corresponding changes in the main repository.

…nt self-mention loops in comments and reports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant