Skip to content

fix(app): treat bare @words in comments as text - #52877

Closed
rafaetri wants to merge 1 commit into
anomalyco:devfrom
rafaetri:bare-mention-text
Closed

rafaetri wants to merge 1 commit into
anomalyco:devfrom
rafaetri:bare-mention-text

Conversation

@rafaetri

@rafaetri rafaetri commented Oct 3, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #50393

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Every @word in a comment was read as a workspace path, so a comment like or should I use @here? attached a file called here and showed "File not found".

Comment mentions now count as files only when they look like paths: they start with ~ or contain /, \, . or #. This is the rule proposed in the issue. Mentions picked from autocomplete in the prompt are separate file parts and are not affected.

Tradeoff: a root-level file with no dot or slash, such as Makefile or LICENSE, no longer attaches from a comment. This includes picking it from the comment editor's @-autocomplete, which inserts the bare name (@Makefile). Typing @./Makefile still attaches it. If you would rather keep the picker working for these files, it could insert @./<name> for them. I am happy to add that here or in a follow-up.

This follows the approach in #50526, which was auto-closed for template compliance rather than reviewed.

How did you verify your code works?

Rebased onto current v2 and re-ran everything:

  • Added a test covering file comments and note comments with @here, @channel and @everyone next to a real @src/shared.ts mention. It fails without the change and passes with it.
  • bun test --conditions=solid --preload ./happydom.ts src/composer/ in packages/app: 76 pass.
  • bun run test:unit in packages/app: 731 pass, 0 fail.
  • bun run check from the repository root passes.

Screenshots / recordings

Not a visual change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composer flags bare @words (e.g. Slack-style @here) as missing files

1 participant