Skip to content

[BUG] [v0.0.7] github run: treat @Cortex and /Cortex` as mentions (case-insensitive) #44439

@sunlight7777777

Description

@sunlight7777777

Project

cortex

Description

cortex github run only detects mentions when the comment body contains the exact substrings @cortex or starts with /cortex. GitHub usernames and slash commands are often typed with different casing (e.g. @Cortex). Those comments are skipped with “Skipping: no Cortex mention detected”, and parse_cortex_command never extracts commands from mixed-case forms.

22122.mp4

Error Message

Debug Logs

System Information

Ubuntu 24.04
RAM 32GB

Screenshots

22122.mp4

Steps to Reproduce

  1. Save a minimal issue_comment payload as event.json (shape matches GitHub’s webhook; only action, issue, and comment are required for parsing):

    {
      "action": "created",
      "issue": { "number": 1, "title": "PR title" },
      "comment": {
        "id": 999,
        "body": "@Cortex help",
        "user": { "login": "alice" }
      }
    }
  2. Run (a dummy token is enough; the handler returns before any HTTP call when the mention is skipped):

    cortex github run --event issue_comment --token dummy --repository owner/repo --event-path event.json
  3. Observe stdout: Skipping: no Cortex mention detected and no “Cortex command detected!”.

  4. Repeat with "body": "@cortex help" and confirm processing proceeds past the mention check. Note: from that point the handler uses the GitHub API (reactions, comments), so you need a valid token and repository for the command to complete without error.

Expected Behavior

Any case variation of @cortex and /cortex should count as a mention and participate in command parsing, consistent with help text (“Mention @cortex anywhere in your comment”)

Actual Behavior

  • Comment: Please @Cortex review this → skipped; no API response.
  • parse_cortex_command uses find("@cortex") and find("/cortex"), so it also fails for mixed case

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingideIssues related to IDEvalidValid issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions