Skip to content

[codex] keep scoped package references as text#4167

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
maxwellyoung:codex/fix-scoped-package-mentions
Jul 22, 2026
Merged

[codex] keep scoped package references as text#4167
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
maxwellyoung:codex/fix-scoped-package-mentions

Conversation

@maxwellyoung

@maxwellyoung maxwellyoung commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #4142.

What changed

  • keep common unquoted @scope/package references as plain composer text instead of file-mention pills
  • preserve canonical autocomplete-generated file links, including paths under @scope/
  • preserve explicit quoted path mentions for ambiguous paths
  • add regression coverage at the shared tokenizer, web segmentation, and Lexical paste-command boundaries

Why

The shared inline-token grammar treated every whitespace-delimited @value as a file mention. The paste handler appends a virtual delimiter before parsing, so pasting a command such as yarn expo install @expo/ui immediately converted the package reference into a folder pill.

Scoped package syntax is ambiguous with a bare relative path. Current file autocomplete already serializes selected paths as canonical Markdown file links, so leaving the ambiguous bare form as package text fixes the paste behavior without weakening selected file mentions. The shared tokenizer is used by web and native mobile composers.

Verification

  • vp check (passes with 10 existing warnings outside this diff)
  • vp run typecheck
  • focused tokenizer, segmentation, and paste tests: 32 passed
  • vp test: 608 files and 4,829 tests passed; 2 files and 7 tests skipped by the existing suite
  • git diff --check

Note

Skip scoped package references as mention tokens in composer inline parsing

  • Adds SCOPED_PACKAGE_REFERENCE_REGEX in composerInlineTokens.ts to detect paths like @scope/pkg or @scope/pkg/sub/path.
  • Unquoted @ mentions matching the scoped package pattern are now skipped by collectMentionTokens; quoted mentions (e.g. @"expo/ui") and canonical markdown file links (e.g. [sub](@scope/pkg/sub)) are still collected.
  • Paste handling in the composer editor also falls back to plain text for scoped package strings, preventing accidental mention creation from pasted install commands or import statements.
  • Behavioral Change: text like @expo/ui or @jane/foo.js that previously may have been treated as mentions will now remain plain text.

Macroscope summarized ef9d15a.


Note

Low Risk
Composer mention parsing only, with broad test coverage and no auth or data-path changes; intentional behavior change for ambiguous @scope/pkg bare text.

Overview
Stops unquoted @scope/package text (e.g. in yarn expo install @expo/ui) from becoming file-mention pills by skipping those paths in the shared collectComposerInlineTokens grammar via SCOPED_PACKAGE_REFERENCE_REGEX.

Canonical markdown file links like [sub](@scope/pkg/sub) and quoted mentions like @"expo/ui" still resolve as mentions; bare @README.md-style paths are unchanged. Regression tests cover the shared tokenizer, web prompt segmentation, Lexical paste handling, and expanded/collapsed cursor mapping when package-like text sits next to real mentions.

Reviewed by Cursor Bugbot for commit ef9d15a. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1fe23e02-f5dd-41c5-832c-5b186e7c3e6b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Jul 19, 2026
Comment thread packages/shared/src/composerInlineTokens.ts Outdated
@maxwellyoung
maxwellyoung marked this pull request as ready for review July 19, 2026 21:40
Comment thread packages/shared/src/composerInlineTokens.ts Outdated
Comment thread packages/shared/src/composerInlineTokens.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Straightforward bug fix that prevents scoped npm package references (e.g., @expo/ui) from being incorrectly parsed as file mentions. The code change is minimal (3 lines adding a regex check) with comprehensive test coverage across 4 test files.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
juliusmarminge force-pushed the codex/fix-scoped-package-mentions branch from e535195 to dd78482 Compare July 20, 2026 16:52
juliusmarminge pushed a commit to maxwellyoung/t3code that referenced this pull request Jul 20, 2026
PR: pingdotgg#4167

Co-authored-by: codex <codex@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dd78482. Configure here.

Comment thread packages/shared/src/composerInlineTokens.ts
maxwellyoung and others added 2 commits July 22, 2026 14:30
PR: pingdotgg#4167

Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the codex/fix-scoped-package-mentions branch from dd78482 to ef9d15a Compare July 22, 2026 12:30
@juliusmarminge
juliusmarminge merged commit c7b21ff into pingdotgg:main Jul 22, 2026
16 checks passed
UNN-Devotek pushed a commit to unn-corp/t3code that referenced this pull request Jul 23, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
AnanduB13 pushed a commit to AnanduB13/t3code that referenced this pull request Jul 23, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Jul 25, 2026
…dotgg#2284) (#184)

* Sidebar v2 beta: flat thread list with a server-backed settled lifecycle (pingdotgg#4026)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
(cherry picked from commit 32c6012)

* fix(settings): validate the add-provider wizard step before advancing (pingdotgg#2813) (pingdotgg#3100)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 282ecb3)

* fix(claude): isolate capability probe from user MCP servers (pingdotgg#4015)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit aa5ec80)

* Preserve connecting status while a turn starts (pingdotgg#4101)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 783692a)

* fix(server): stop restoring stale OpenCode models (pingdotgg#4095)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 4e09cdd)

* [codex] keep scoped package references as text (pingdotgg#4167)

Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c7b21ff)

* fix(web): default provider selection for users without Codex (pingdotgg#4117)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit b6e1b39)

* Unify temporary worktree branch naming (pingdotgg#4278)

(cherry picked from commit 571a8b4)

* fix(web): use message-square icon for settled icon-less project threads in sidebar v2 (pingdotgg#4279)

(cherry picked from commit 020179c)

* Stabilize sidebar settling animations (pingdotgg#4280)

(cherry picked from commit 18b4688)

* Restore Copy Link in chat link context menu (pingdotgg#4161)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit e5fba26)

* fix(desktop): handle EPIPE errors on stdout/stderr to prevent crash dialog (pingdotgg#4213)

(cherry picked from commit f74eb62)

* Preserve draft thread highlighting during promotion (pingdotgg#4283)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 18fa89c)

* Move mobile working timer into the thread timeline (pingdotgg#4285)

(cherry picked from commit 7e2bb47)

* Stabilize PR status lookups and provider session lifecycle (pingdotgg#4281)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 376c149)

* fix: open command palette instead of custom dialog for new thread picker in SidebarV2 (pingdotgg#4269)

(cherry picked from commit 9fe4832)

* fix(server): don't drop sticky PR fallback when remote URL can't be resolved (pingdotgg#4289)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 9a0a071)

* feat(web): copy branch name via right-click in the branch selector (pingdotgg#4275)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 78a0ea5)

* Add remote server updates and standalone service management (pingdotgg#4286)

Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit ab4a883)

* Refine light-mode sidebar surfaces (pingdotgg#4268)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 593289c)

* fix(mobile): don't mark Android VPN/Tailscale as offline when connected (pingdotgg#3949)

(cherry picked from commit bc9428a)

* improve and prevent silent thread branch drift and PR fetching (pingdotgg#2284)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
(cherry picked from commit 2d31cb0)

* fix(sync): restore fork migration IDs under Sidebar v2 settled

Upstream pingdotgg#4026 replaced Migrations.ts with linear upstream numbering and
dropped fork-only migrations (NormalizeLegacyProviderKinds,
RepairProposedPlanColumns, BackfillForkProviderInstanceIds). Restore the
fork registry and append ProjectionThreadsSettled as ID 36.

Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>

---------

Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Leonel Rivas <encriptandost@gmail.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Jaret Bottoms <jaretbottoms@gmail.com>
Co-authored-by: Ishan <ishansachu1@gmail.com>
Co-authored-by: Yukun Shan <92423096+nateEc@users.noreply.github.com>
Co-authored-by: Maxwell Young <maxtheyoung@gmail.com>
Co-authored-by: Miklós Fazekas <mfazekas@szemafor.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: Henry Zhang <113233555+caezium@users.noreply.github.com>
Co-authored-by: Rushikesh Gaikwad <81632222+Wraient@users.noreply.github.com>
Co-authored-by: legs <145564979+justsomelegs@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: aaditagrawal <aaditagrawal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: paste @expo/ui in the chat convert it into ui folder automatically

2 participants