Skip to content

fix(github): require a handle boundary after @gittensory in mention parsing - #1345

Closed
galuis116 wants to merge 1 commit into
JSONbored:mainfrom
galuis116:fix/gittensory-mention-handle-boundary
Closed

fix(github): require a handle boundary after @gittensory in mention parsing#1345
galuis116 wants to merge 1 commit into
JSONbored:mainfrom
galuis116:fix/gittensory-mention-handle-boundary

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

Summary

Fixes #1344.

parseGittensoryMentionCommand matched the bot handle with no boundary after @gittensory, so the handle matched as a prefix of a longer GitHub username. A comment mentioning a different account such as @gittensory-bot or @gittensory2 was parsed as a bare @gittensory help, and the only caller then posted an unsolicited help reply on that thread.

What changed

  • Added a (?![\w-]) boundary after @gittensory in the mention regex. GitHub usernames are word characters + hyphen, so the lookahead rejects @gittensory-bot / @gittensory2 / @gittensorybot while still matching bare @gittensory, @gittensory <command>, and punctuation boundaries.

Scope

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage locally (github-commands suite green); the changed regex line is fully covered, including the now-rejected longer-handle cases and the retained positive cases.
  • npm audit --audit-level=moderate
  • New unit tests for @gittensory-bot / @gittensory2 / @gittensorybot → null, and a punctuation-boundary positive case.

If any required check was skipped, explain why:

  • OpenAPI/types unchanged — internal command-parsing logic only.

Safety

  • No secrets, wallets, hotkeys, PATs, trust scores, or private evidence exposed.
  • Public text sanitized and low-noise.
  • GitHub App command-parsing change includes negative-path tests (mentions of other handles now correctly ignored).
  • API/OpenAPI/MCP behavior unchanged.
  • No UI changes.
  • No changelog edit.

Notes

  • Confined to the regex in parseGittensoryMentionCommand (src/github/commands.ts); no schema, migration, or binding changes.

@galuis116
galuis116 requested a review from JSONbored as a code owner June 25, 2026 09:27
@dosubot dosubot Bot added the size:XS label Jun 25, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent did not find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.25%. Comparing base (2e99233) to head (52d015e).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1345   +/-   ##
=======================================
  Coverage   95.25%   95.25%           
=======================================
  Files         188      188           
  Lines       20314    20314           
  Branches     7319     7319           
=======================================
  Hits        19350    19350           
  Misses        378      378           
  Partials      586      586           
Files with missing lines Coverage Δ
src/github/commands.ts 97.44% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[Bug]: @gittensory mention regex matches longer handles (@gittensory-bot) as a bare command

1 participant