Skip to content

fix(clients): dedupe skills in composer menus - #8043

Open
Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:workflow/fix-duplicate-composer-skills
Open

fix(clients): dedupe skills in composer menus#8043
Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:workflow/fix-duplicate-composer-skills

Conversation

@Adamulek123

@Adamulek123 Adamulek123 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Collapse enabled provider skills by case-insensitive name before building composer menu rows.
  • Preserve the provider's first resolved definition and the order of unrelated skills.
  • Apply the same rule to / and $ menus on web and mobile.
  • Add regression coverage for duplicate names separated by another skill.

Why

Codex can report the same skill name from both .codex and .agents. The composer rendered every definition with the same row ID, so duplicate rows highlighted together. Hovering a later duplicate also scrolled the menu to the first row with that ID, skipping entries between them.

Skill invocation is name-based, so multiple same-name rows are not independently selectable. Keeping one row per name makes the menu match what the user can invoke and restores one-to-one highlight and scroll targets.

UI Changes

Before After
Duplicate skills before Deduplicated skills after

The after image uses the same duplicated .codex and .agents skill setup. Each skill now has one row and one hover target.

Validation

  • vp test run packages/client-runtime/src/providerSkills.test.ts apps/web/src/providerSkillSearch.test.ts (16 tests passed)
  • vp run --filter @t3tools/client-runtime typecheck
  • vp run --filter @t3tools/web typecheck
  • vp run --filter @t3tools/mobile typecheck
  • Targeted vp lint and vp fmt on all five changed files
  • Integrated desktop verification with the reported duplicated skill directories: Babysit Pr and Branch Audit each render once
  • Verified hover moves from Branch Audit to Babysit Pr without highlighting another row or jumping the menu
  • Verified the $ skill menu applies the same deduplication
  • Latest-head CI and Macroscope correctness, UI consistency, and Effect checks pass

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for the UI change
  • No animation or timing behavior changed

Model: GPT-5.6 Sol
Harness: Codex


Note

Low Risk
UI-only filtering of already-enabled skills; invocation remains name-based and tests cover first-wins plus disabled-then-enabled duplicates.

Overview
Stops composer / and $ skill menus from listing the same skill twice when a provider reports it from multiple paths (e.g. .codex and .agents). Duplicate names used the same row ID, so hover/highlight jumped between copies.

Adds dedupeProviderSkillsByName, which keeps the first enabled definition (case-insensitive) and order of other skills. Slash menus go through getProviderSkillsForSlashMenu; web $ search and mobile $ menus apply the same helper.

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

Note

Dedupe skills by name in composer slash menus and searchProviderSkills

  • Adds dedupeProviderSkillsByName to providerSkills.ts, which keeps only the first occurrence per case-insensitive, trimmed skill name.
  • getProviderSkillsForSlashMenu and searchProviderSkills now dedupe enabled skills before returning or ranking them.
  • Updates ThreadComposer.tsx to use getProviderSkillsForSlashMenu(..., true) for skill menu items and dedupeProviderSkillsByName for enabled skills in the skill-trigger branch.
  • Behavioral Change: slash menus and skill search now show at most one enabled skill per name; the first encountered definition wins.

Macroscope summarized eb99052.

@coderabbitai

coderabbitai Bot commented Aug 24, 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 Plus

Run ID: 8f5b8074-86c3-4456-95ae-8f9cca577c7d

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

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:M 30-99 changed lines (additions + deletions). labels Aug 24, 2026
}

const skillItems = (selectedProviderStatus?.skills ?? [])
const skillItems = dedupeProviderSkillsByName(selectedProviderStatus?.skills ?? [])

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.

🟡 Medium threads/ThreadComposer.tsx:435

The / menu drops an enabled skill when a disabled duplicate with the same normalized name appears first: dedupeProviderSkillsByName retains the disabled definition, matchesSlashSkillQuery removes it, and the enabled duplicate is never shown. Filter to enabled skills before deduplicating, as the $ branch does.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/mobile/src/features/threads/ThreadComposer.tsx around line 435:

The `/` menu drops an enabled skill when a disabled duplicate with the same normalized name appears first: `dedupeProviderSkillsByName` retains the disabled definition, `matchesSlashSkillQuery` removes it, and the enabled duplicate is never shown. Filter to enabled skills before deduplicating, as the `$` branch does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

gpt-5.6-sol - responding

Fixed in eb99052. Mobile / now uses the shared helper that filters disabled skills before deduplicating, matching web behavior. Added regression coverage for a disabled definition preceding an enabled duplicate; 16 focused tests and the client-runtime/mobile typechecks pass.

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.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

@Adamulek123
Adamulek123 marked this pull request as ready for review August 24, 2026 00:45
@macroscopeapp

macroscopeapp Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — This is a small, self-contained composer-menu bug fix: enabled skills are filtered before case-insensitive name deduplication, removing duplicate rows without changing provider or server behavior. The listed medium finding concerned a disabled-before-enabled duplicate, which the current head addresses and covers with regression tests.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

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

Labels

size:M 30-99 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.

1 participant