Skip to content

Conversation

@daniel-oai
Copy link
Contributor

What changed

  • In codex-rs/core/src/skills/injection.rs, we now honor explicit UserInput::Skill { name, path } first, then fall back to text mentions only when safe.
  • In codex-rs/tui/src/bottom_pane/chat_composer.rs, mention selection is now token-bound (selected mention is tied to the specific inserted $token), and we snapshot bindings at submit time so selection is not lost.
  • In codex-rs/tui/src/chatwidget.rs and codex-rs/tui/src/bottom_pane/mod.rs, submit/queue paths now consume the submit-time mention snapshot (instead of rereading cleared composer state).
  • In codex-rs/tui/src/mention_codec.rs and codex-rs/tui/src/bottom_pane/chat_composer_history.rs, history now round-trips mention targets so resume restores the same selected duplicate.
  • In codex-rs/tui/src/bottom_pane/skill_popup.rs and codex-rs/tui/src/bottom_pane/chat_composer.rs, duplicate labels are normalized to [Repo] / [App], app rows no longer show Connected -, and description space is a bit wider.
Screenshot 2026-02-05 at 9 56 56 PM Screenshot 2026-02-05 at 9 57 09 PM

Before vs now

  • Before: selecting a duplicate could still submit the default/repo match, and resume could lose which duplicate was originally selected.
  • Now: the exact selected target (skill path or app id) is preserved through submit, queue/restore, and resume.

Manual test

  1. Build and run this branch locally:
    • cd /Users/daniels/code/codex/codex-rs
    • cargo build -p codex-cli --bin codex
    • ./target/debug/codex
  2. Open mention picker with $ and pick a duplicate entry (not the first one).
  3. Confirm duplicate UI:
    • repo duplicate rows show [Repo]
    • app duplicate rows show [App]
    • app description does not start with Connected -
  4. Submit the prompt, then press Up to restore draft and submit again.
    Expected: it keeps the same selected duplicate target.
  5. Use /resume to reopen the session and send again.
    Expected: restored mention still resolves to the same duplicate target.

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5def75d495

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@daniel-oai daniel-oai force-pushed the daniels-oai/skill-duplication-and-resume branch from 17c1372 to ffdefc3 Compare February 6, 2026 21:09
}

#[derive(Clone, Debug)]
struct ComposerMentionBinding {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@codex can you help me understand how we use MentionBinding? More specially:

  1. When do we set MentionBinding;
  2. How do we clear MentionBinding.

Copy link
Contributor

Choose a reason for hiding this comment

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

Answer

1. When do we set MentionBinding?

2. How do we clear MentionBinding?

Commands Used

  • sed -n '1,220p' codex-rs/tui/src/bottom_pane/chat_composer.rs
  • rg -n "MentionBinding" codex-rs/tui/src/bottom_pane/chat_composer.rs
  • sed -n '260,520p' codex-rs/tui/src/bottom_pane/chat_composer.rs
  • sed -n '780,980p' codex-rs/tui/src/bottom_pane/chat_composer.rs
  • sed -n '1820,1985p' codex-rs/tui/src/bottom_pane/chat_composer.rs
  • rg -n "mention_bindings\\.clear|mention_bindings =|mention_bindings\\.insert" codex-rs/tui/src/bottom_pane/chat_composer.rs
  • rg -n "set_text_content\\(" -n codex-rs/tui/src/bottom_pane/chat_composer.rs
  • rg -n "take_mention_bindings\\(|mention_bindings\\(" codex-rs/tui/src
  • sed -n '220,520p' codex-rs/tui/src/bottom_pane/mod.rs
  • sed -n '3000,3095p' codex-rs/tui/src/chatwidget.rs
  • nl -ba codex-rs/tui/src/bottom_pane/chat_composer.rs | sed -n '720,860p'
  • nl -ba codex-rs/tui/src/bottom_pane/chat_composer.rs | sed -n '1828,1935p'
  • nl -ba codex-rs/tui/src/bottom_pane/chat_composer.rs | sed -n '1935,1965p'
  • nl -ba codex-rs/tui/src/bottom_pane/chat_composer.rs | sed -n '420,450p'

View task →

@daniel-oai daniel-oai merged commit 84bce2b into main Feb 6, 2026
32 checks passed
@daniel-oai daniel-oai deleted the daniels-oai/skill-duplication-and-resume branch February 6, 2026 23:59
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants