Skip to content

Fix @mention token parsing in chat composer#12643

Merged
etraut-openai merged 6 commits intomainfrom
etraut/issue-12175
Feb 24, 2026
Merged

Fix @mention token parsing in chat composer#12643
etraut-openai merged 6 commits intomainfrom
etraut/issue-12175

Conversation

@etraut-openai
Copy link
Collaborator

@etraut-openai etraut-openai commented Feb 24, 2026

Fixes #12175

If a user types an npm package name with multiple @ symbols like npx -y @foo/bar@latest, the TUI currently treats this as though it's attempting to invoke the file picker.

What changed

  • Generalized @ token parsing

    • current_prefixed_token(...) now treats @ as a token start only at a whitespace boundary (or start-of-line).
    • If the cursor is on a nested @ inside an existing whitespace-delimited token (for example @scope/pkg@latest), it keeps the surrounding token active instead of starting a new token at the second @.
    • It also avoids misclassifying mid-word usages like foo@bar as an @ file token.
  • Enter behavior with file popup

    • If the file-search popup is open but has no selected match, pressing Enter now closes the popup and falls through to normal submit behavior.
    • This prevents pasted strings containing @... from blocking submission just because file-search was active with no actionable selection.

Testing

I manually built and tested the scenarios involved with the bug report and related use of @ mentions to verify no regressions

@etraut-openai
Copy link
Collaborator Author

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4885df5c14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
Copy link
Collaborator Author

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9d41b44a82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
Copy link
Collaborator Author

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20d4e55415

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
Copy link
Collaborator Author

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20d4e55415

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai etraut-openai merged commit 74cebce into main Feb 24, 2026
76 of 83 checks passed
@etraut-openai etraut-openai deleted the etraut/issue-12175 branch February 24, 2026 18:50
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex TUI treats scoped npm package strings as @ file mentions and blocks normal Enter submit

2 participants