codex - 💡(How to fix) Fix TUI skill mention popup shows duplicate entries for the same skill name [2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19622Fetched 2026-04-26 05:13:46
View on GitHub
Comments
2
Participants
1
Timeline
9
Reactions
0
Participants
Timeline (top)
labeled ×5commented ×2unlabeled ×2

The TUI skill mention popup can show duplicate entries for the same skill invocation when the same skill name is available from multiple scopes and one copy has an interface display name.

Example observed from a repo with both user-level and repo-level SDLC skills:

  • SDLC [Skill] ...
  • sdlc [Skill] ...

Both entries insert the same $sdlc token, so the popup looks like two different commands even though the invocation name is identical. This is confusing in repos where a repo-local skill intentionally overrides or specializes a user-level skill.

Root Cause

ChatComposer::mention_items currently iterates every skill metadata entry and builds one MentionItem per entry. The item display label comes from skill_display_name, which can use interface.display_name, while the inserted token still uses skill.name.

That means these two skills render as visually distinct rows but insert the same token:

  • user skill: name = "sdlc", interface.display_name = "SDLC"
  • repo skill: name = "sdlc", no display name

Fix Action

Fix / Workaround

Patch shape tested locally

I tested a focused TUI patch that dedupes skill mention rows by skill.name before building MentionItems. The dedupe policy preserves first-seen order, but replaces an existing entry when a later skill with the same name has a higher-priority scope:

Those blockers are separate from this skill mention popup patch; the targeted duplicate-skill tests pass.

Code Example

sdlc  [Skill] Repo SDLC workflow

---

cargo test -p codex-tui mention_items_deduplicate
cargo test -p codex-tui skill_mention_popup_dedupes_same_name_snapshot
just fmt
RAW_BUFFERClick to expand / collapse

Summary

The TUI skill mention popup can show duplicate entries for the same skill invocation when the same skill name is available from multiple scopes and one copy has an interface display name.

Example observed from a repo with both user-level and repo-level SDLC skills:

  • SDLC [Skill] ...
  • sdlc [Skill] ...

Both entries insert the same $sdlc token, so the popup looks like two different commands even though the invocation name is identical. This is confusing in repos where a repo-local skill intentionally overrides or specializes a user-level skill.

Expected behavior

When multiple skills share the same SkillMetadata.name, the mention popup should show one entry for that invocation name. Repo-scoped skills should take precedence over user/system/admin scopes because repo-local instructions are the most specific.

Root cause

ChatComposer::mention_items currently iterates every skill metadata entry and builds one MentionItem per entry. The item display label comes from skill_display_name, which can use interface.display_name, while the inserted token still uses skill.name.

That means these two skills render as visually distinct rows but insert the same token:

  • user skill: name = "sdlc", interface.display_name = "SDLC"
  • repo skill: name = "sdlc", no display name

Patch shape tested locally

I tested a focused TUI patch that dedupes skill mention rows by skill.name before building MentionItems. The dedupe policy preserves first-seen order, but replaces an existing entry when a later skill with the same name has a higher-priority scope:

Repo > User > System > Admin

This matches the existing skill-root cache ranking used elsewhere in core-skills.

Regression tests added locally

  • mention_items_deduplicate_same_skill_name_preferring_repo_scope
  • mention_items_deduplicate_preserves_first_seen_skill_order
  • skill_mention_popup_dedupes_same_name_snapshot

The snapshot verifies the popup renders a single row:

sdlc  [Skill] Repo SDLC workflow

Local verification

Targeted tests pass:

cargo test -p codex-tui mention_items_deduplicate
cargo test -p codex-tui skill_mention_popup_dedupes_same_name_snapshot
just fmt

Full-suite note on Windows

The broader Windows cargo test -p codex-tui run is currently blocked locally by unrelated Windows TUI test failures:

  • without RUST_MIN_STACK, several unrelated app::tests::* cases abort with STATUS_STACK_OVERFLOW; see #19596
  • with RUST_MIN_STACK=16777216, stack overflow clears, but three unrelated status::helpers::*compose_agents_summary* path-display assertions fail because expected ~\AppData\... differs from actual C:\Users\...\AppData\...

Those blockers are separate from this skill mention popup patch; the targeted duplicate-skill tests pass.

I can open a PR with the focused patch if contributor permissions/invitation allow it.

extent analysis

TL;DR

The issue can be fixed by deduplicating skill mention rows by skill.name before building MentionItems, preserving the first-seen order and replacing existing entries with higher-priority scopes.

Guidance

  • The current implementation of ChatComposer::mention_items should be modified to dedupe skill metadata entries by skill.name to prevent duplicate entries in the mention popup.
  • The dedupe policy should prioritize skills by scope in the order of Repo > User > System > Admin to ensure that repo-scoped skills take precedence over user/system/admin scopes.
  • Regression tests, such as mention_items_deduplicate_same_skill_name_preferring_repo_scope and skill_mention_popup_dedupes_same_name_snapshot, should be added to verify the fix.
  • The fix can be verified by running targeted tests, such as cargo test -p codex-tui mention_items_deduplicate and cargo test -p codex-tui skill_mention_popup_dedupes_same_name_snapshot.

Example

No code snippet is provided as the issue does not contain sufficient code context.

Notes

The fix may not apply to all platforms, as the issue is currently blocked on Windows due to unrelated test failures. The fix should be tested on multiple platforms to ensure its correctness.

Recommendation

Apply the workaround by deduplicating skill mention rows by skill.name and prioritizing skills by scope. This fix addresses the issue and ensures that the mention popup shows one entry for each invocation name, with repo-scoped skills taking precedence over user/system/admin scopes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When multiple skills share the same SkillMetadata.name, the mention popup should show one entry for that invocation name. Repo-scoped skills should take precedence over user/system/admin scopes because repo-local instructions are the most specific.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix TUI skill mention popup shows duplicate entries for the same skill name [2 comments, 1 participants]