Skip to content

TUI skill picker uses display_name casing, causing explicit-only skill invocation to fail #43727

Closed

Description

@KristianDamPedersen

What version of Codex CLI is running?

codex-cli 0.149.1

Platform

Arch Linux, kernel 7.1.9, x86_64

Originator

codex-tui, source cli

What issue are you seeing?

Selecting an explicit-only skill from the $ picker produces a mention using the
skill's title-cased interface.display_name. The canonical skill name is lowercase.

The picker-generated mention fails. Manually typing the canonical lowercase name
succeeds.

The valid skill appears in the picker, but selection immediately produces:

The Wayfinder skill is not available in this session.

Skill metadata

SKILL.md:

---
name: wayfinder
description: Plan a large effort as a shared map of decision tickets.
disable-model-invocation: true
---

agents/openai.yaml:

interface:
  display_name: "Wayfinder"
  short_description: "Map a large effort as decision tickets"
policy:
  allow_implicit_invocation: false

The skill is installed at:

~/.agents/skills/wayfinder/SKILL.md

There is no skills.config entry disabling it.

Reproduction

  1. Start a fresh Codex TUI session.
  2. Open the $ skill picker.
  3. Select Wayfinder.
  4. Submit $Wayfinder #1.
  5. Observe that Codex reports the skill unavailable.
  6. Start another fresh session.
  7. Manually type $wayfinder #1.
  8. Observe that Codex loads and follows the skill.

Redacted rollout evidence

Picker invocation:

session_meta:
  cli_version: 0.149.1
  originator: codex-tui
  source: cli

user:
  $Wayfinder #1

assistant:
  The Wayfinder skill is not available in this session.

Manual invocation:

session_meta:
  cli_version: 0.149.1
  originator: codex-tui
  source: cli

user:
  $wayfinder #1

assistant:
  I'm using Wayfinder to load map #1...

I reproduced the picker failure in at least four fresh sessions.

Suspected cause

The picker appears to submit interface.display_name as a plain $name token
instead of submitting the canonical skill identity or a structured
UserInput::Skill.

Plain mention selection currently calls:

mentions.contains_plain_name(skill.name.as_str())

contains_plain_name performs an exact set lookup. Therefore $Wayfinder does
not match the canonical name wayfinder.

Expected behavior

Selecting a skill from the picker should invoke that exact skill regardless of
display-name capitalization.

The picker could submit a structured UserInput::Skill containing the canonical
path, emit the canonical name, or make plain-name comparison case-insensitive.

Related issues

Activity

  1. added
    bug
    CLI
    skills
    TUI
    on Sep 8, 2026
  2. Hughhhhcoder commented on Sep 8, 2026

    @Hughhhhcoder

    I tried to reproduce this against both rust-v0.149.1 and current main, but the picker path appears to preserve the canonical identity already.

    In both versions, the skill catalog uses interface.display_name only for rendering/search and sets insert_text to format!("${skill_name}"), with the canonical skill.path as the binding. I also added a focused interaction test locally with canonical name wayfinder, display name Wayfinder, typed $Way, and selected the popup row. It passed with composer text $wayfinder and a binding to /tmp/wayfinder/SKILL.md.

    Could you check what text is visible in the composer immediately after selecting the row, before submission? If it is actually $Wayfinder, could you also share how this binary was installed plus the output of which codex and codex --version? A short screen recording showing the text before and after selection would help distinguish a packaged-binary mismatch from a later submission/history path. The reported direct picker code path does not currently reproduce the casing conversion.

  3. argszero commented on Sep 8, 2026

    @argszero

    Confirmed the root cause against current main — and it's a genuine case-sensitivity defect in the plain-name skill match, not just a picker-emission quirk.

    The locus

    The mention parser preserves the case of whatever $name token appears in the text. extract_tool_mentions_with_sigil (codex-rs/skills/src/mentions.rs) pushes the token as-is into plain_names:

    let name = &text[name_start..name_end];
    if !is_common_env_var(name) {
        mentioned_names.insert(name);
        plain_names.insert(name);   // "Wayfinder" stays "Wayfinder"
    }

    Then selection does an exact case-sensitive set lookup against the canonical skill.name (codex-rs/skills/src/selection.rs:174):

    if !mentions.contains_plain_name(skill.name.as_str()) {
        continue;   // "Wayfinder" never matches canonical "wayfinder"
    }

    contains_plain_name (mentions.rs:18) is self.plain_names.contains(name) — a HashSet<&str>, byte-exact. So $Wayfinder (title-cased) produces plain_names = {"Wayfinder"}, which does not equal the canonical skill.name = "wayfinder". The skill is skipped → "The Wayfinder skill is not available in this session".

    Why this is the bug, not just the picker

    Even where the picker emits the canonical $wayfinder (the mention_items() path builds insert_text: format!("${skill_name}")), the match is still fragile: any plain $Name with non-canonical casing (manual typing, a picker that surfaces the display_name, an agent emitting it) silently fails. The reporter's transcript showing $Wayfinder is one such path. The defect is the case-sensitive exact-match on plain names, not a single emission site — that's why it has multiple faces.

    Fix shape (small, contained)

    Two options, both localized:

    1. Emit canonical — ensure every picker path inserts skill.name (not display_name / interface.display_name). This fixes the picker but leaves the manual-typing footgun.
    2. Make plain-name matching case-insensitive at the comparison site (preferred — fixes all paths): in select_skills_from_mentions, when a mention's plain name matches skill.name ignoring ASCII case (and the name is unambiguous via skill_name_counts), select it. Hash on lowercase: mentions.plain_names().any(|n| n.eq_ignore_ascii_case(skill.name)) in place of contains_plain_name(skill.name).

    skill.name is documented as lowercase canonical, and the existing skill_name_counts disambiguation already guards ambiguity, so a case-insensitive plain-name lookup is safe. No current test pins the case-sensitive behavior (selection_tests.rs/mentions_tests.rs have no case-sensitivity assertion), so a regression test ($Wayfinder selects the wayfinder skill) is straightforward.

    The change touches selection.rs + a regression test in the skills crate. Happy to prepare the patch.

  4. argszero commented on Sep 8, 2026

    @argszero

    Thanks for the careful verification — I traced the same path and it agrees with your finding. On current main the picker keeps the canonical identity end-to-end, so the plain-name case-sensitivity is a real latent defect but not the cause of the reported $Wayfinder symptom.

    Confirmed: the picker path is canonical on current main

    • mention_items() builds insert_text: format!("${skill_name}") (chat_composer.rs:4288) — canonical, not display_name.
    • UserInput::Skill construction (input_submission.rs:239,253) uses skill.name.clone() and the canonical skill.path — no display_name.
    • skill_display_name() (skills_helpers.rs:4) is used only for rendering/search (mentions_v2/search_catalog.rs:68, chatwidget/skills.rs:76), never for the inserted token.

    So on both rust-v0.149.1 and current main, selecting a skill row inserts $wayfinder with the canonical skill:// binding. The reported $Wayfinder is not produced by this path.

    The latent defect (worth an #23454-adjacent note, but not the symptom's cause)

    extract_tool_mentions_with_sigil (skills/src/mentions.rs:139) preserves whatever casing is in the text, and select_skills_from_mentions (skills/src/selection.rs:174) does an exact case-sensitive contains_plain_name(skill.name). So a manually typed $Wayfinder (or an agent/abbreviated re-insert) would still fail to match canonical wayfinder even though the picker is fine. That's a separate robustness gap, not the picker regression.

    The discriminating question for the reporter

    The user's transcript showing $Wayfinder almost certainly came from a path that isn't the live picker. As @Hughhhhcoder suggested, the key data is: what is the exact composer text immediately after selecting the row (before submission)? If it shows $Wayfinder, then this binary was built from a source state (or a packaged bundle / extension hook) that pre-dates the canonical insert; if it shows $wayfinder, the failure is in a later submission/history path. The reporter's codex --version, which codex, and how it was installed would resolve a packaged-binary mismatch.

    I'd suggest the maintainer close this as not-a-picker-regression (the picker path is canonical and verified) and either split the case-sensitivity robustness gap into a separate low-priority issue or leave it open as a hardening item. Happy to prepare the small case-insensitive match patch if the team wants the robustness fix regardless.

  5. SurefireStudios commented on Sep 9, 2026

    @SurefireStudios

    I went looking for this and think the suspected cause is off, so flagging that before anyone spends time on the picker.

    The picker already emits the canonical name

    Both production paths that build a $ skill mention use skill.name, not interface.display_name:

    • codex-rs/tui/src/bottom_pane/chat_composer.rs, in mention_items → insert_text: format!("${skill_name}")
    • codex-rs/tui/src/bottom_pane/mentions_v2/search_catalog.rs → insert_text: format!("${skill_name}")

    I checked both at main and at the rust-v0.149.1 tag, since that is the version in the report, and they are the same on both. The selected item is inserted via insert_selected_mention(...), which inserts exactly that insert_text and additionally registers a mention_bindings entry carrying the skill path.

    There is a format!("${display_name}") in skill_popup.rs, which looks like the culprit on a grep, but it sits inside #[cfg(test)] mod tests as the ranked_mention_item helper. It is not a code path.

    So I could not reproduce "the picker submits display_name" from the source at the reported version. If the composer really did show $Wayfinder after selecting from the picker, something I have not found is producing it, and it would be worth knowing whether the token in the composer read $Wayfinder or $wayfinder before submitting.

    What is reproducible

    The symptom stands regardless of how the casing arises, because plain-name matching is exact:

    pub fn contains_plain_name(&self, name: &str) -> bool {
        self.plain_names.contains(name)
    }

    The picker displays Wayfinder. Anyone who types back the spelling they were shown gets "The Wayfinder skill is not available in this session", with nothing pointing at case as the reason. That is a real gap on main today, and it is the third remedy suggested in the issue.

    Patch

    One wrinkle is worth calling out: once matching ignores case, two skills whose names differ only in case become one ambiguous name rather than two that each resolve independently. The ambiguity guard has to count the same way, or $wayfinder with both wayfinder and Wayfinder loaded would quietly resolve to whichever loaded first. build_skill_name_counts already returns an ASCII-lowercase tally alongside the exact one, so this needs no new plumbing, only the other element of the pair.

    --- a/codex-rs/skills/src/mentions.rs
    +++ b/codex-rs/skills/src/mentions.rs
    @@ impl<'a> ToolMentions<'a> {
    +    /// Skill names are matched without regard to ASCII case. The `$` picker lists a
    +    /// skill by its `interface.display_name`, which is free to be title-cased while the
    +    /// canonical name is not, so a reader who types back what the picker showed them
    +    /// would otherwise be told the skill does not exist.
         pub fn contains_plain_name(&self, name: &str) -> bool {
    -        self.plain_names.contains(name)
    +        self.plain_names
    +            .iter()
    +            .any(|plain_name| plain_name.eq_ignore_ascii_case(name))
         }
    --- a/codex-rs/skills/src/selection.rs
    +++ b/codex-rs/skills/src/selection.rs
    @@ pub fn collect_explicit_skill_mentions(
    +    // The ASCII-lowercase tally, because plain-name mentions are matched without regard
    +    // to case. Two skills differing only in case are one ambiguous name, not two names
    +    // that each resolve on their own.
         let skill_name_counts =
    -        build_skill_name_counts(loaded_skills.skills(), loaded_skills.disabled_paths()).0;
    +        build_skill_name_counts(loaded_skills.skills(), loaded_skills.disabled_paths()).1;
    @@ for input in inputs {
             if let UserInput::Skill { name, path, .. } = input {
    -            blocked_plain_names.insert(name.clone());
    +            blocked_plain_names.insert(name.to_ascii_lowercase());
    @@ fn select_skills_from_mentions(
    -        if blocked_plain_names.contains(skill.name.as_str()) {
    +        if blocked_plain_names.contains(&skill.name.to_ascii_lowercase()) {
                 continue;
             }
    @@
             let skill_count = selection_context
                 .skill_name_counts
    -            .get(skill.name.as_str())
    +            .get(&skill.name.to_ascii_lowercase())
                 .copied()
                 .unwrap_or(0);

    The lowercased block list keeps a structured UserInput::Skill suppressing the plain-name fallback when the text spells the name differently. contains_plain_name has no callers outside the crate, and the only external caller of build_skill_name_counts already takes the lowercase tally for connector slugs, so nothing downstream changes shape. The linear scan replaces a hash lookup over a set holding at most a handful of names parsed from one message.

    Tests

    Four added, three of which fail without the change:

    test fails without the patch
    contains_plain_name_ignores_ascii_case yes
    collect_explicit_skill_mentions_matches_mention_casing_insensitively ($Wayfinder) yes
    collect_explicit_skill_mentions_treats_case_variants_as_one_ambiguous_name yes
    collect_explicit_skill_mentions_blocks_plain_fallback_across_casing no, regression guard

    cargo test -p codex-skills gives 55 passed, and clippy and rustfmt are clean on the crate.

    I would have opened a PR, but this repo appears not to take them from forks: none of the last 100 pull requests originate outside openai/codex. The full branch including tests is at https://github.com/SurefireStudios/codex/tree/fix/case-insensitive-skill-mentions if it is useful to pull from. Happy to adjust the approach if you would rather fix it in the picker or by submitting a structured UserInput::Skill.

  6. etraut-openai commented on Oct 12, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Closing because in CLI 0.162.1 both skill picker paths insert the canonical skill name (for example, $wayfinder), independently of the display label Wayfinder. The reported display-name casing mechanism no longer applies. If you can still produce $Wayfinder by selecting that skill on a current release, please reopen with the picker steps; other skill-availability failures may have a different cause.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLITUIbugskills

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions