Skip to content

[Bug]: Claude provider switch re-runs skill mentions from the handoff history as live slash commands #34393

Closed

Description

@Amaricso

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. In a Codex thread, send a message that invokes a skill which also exists for Claude, e.g. $my-skill do something.
  2. Let Codex answer (or hit its usage limit) so that this message ends up in the thread history.
  3. Switch the thread's provider to Claude and send a plain message without any skill, e.g. continue.

Expected behavior

Only skill mentions in the new user message are dispatched. Skill mentions inside the handoff history stay plain history text, and the Claude turn starts as a normal message.

Actual behavior

The Claude turn starts as the slash command /my-skill with the arguments do something … [rest of the history] … User message: continue, so Claude runs the old skill again and treats the historical request as the current one.

Cause: withInlineContext (ContextHandoffDelivery.ts) builds ${context}\n\nUser message:\n${userText}, and the Claude adapter calls planClaudeSkillDispatch(text, skills) on that whole string. It matches $name mentions inside the historical user messages, picks the last one and turns everything after it into the command arguments. Mentions in the history are also rewritten to /name.

Impact

Minor bug or occasional failure

Version or commit

0.1.7 (Linux AppImage)

Environment

Linux (Arch), T3 Code desktop AppImage 0.1.7, provider switch Codex -> Claude (Claude Agent SDK)

Logs or stack traces

# first record of the new Claude session after "continue" (shortened)
<command-message>my-skill</command-message>
<command-name>/my-skill</command-name>
<command-args>do something

[Historical assistant; assistant_message; ...]
...
User message:
continue</command-args>

Screenshots, recordings, or supporting files

No response

Workaround

A local patch on 0.1.7 that remembers the exact prefix built by withInlineContext (last 16) and makes planClaudeSkillDispatch skip mentions that start inside that prefix. Mentions in the user's own text still dispatch normally. A cleaner upstream fix would be to run the skill dispatch on userText only, or pass the context length to the adapter.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions