Skip to content

Dynamically registered extension slash commands show unknown command even when they execute successfully #2674

Open

Description

@tstager

Summary

When an extension adds a slash command dynamically after session startup, Copilot CLI can show an unknown command error in the UI even though the command still executes successfully in the extension.

This looks like the local slash-command validation path is out of sync with the dynamically registered command list.

Environment

  • Copilot CLI: 1.0.25
  • OS: Windows

Reproduction

I reproduced this with a Telegram bridge extension that:

  1. joins the session with joinSession(...)
  2. then registers /telegram afterward via a follow-up session.resume request with a commands payload
  3. handles the command through the extension command event path

Relevant pattern in the extension:

await sess.connection.sendRequest("session.resume", {
  sessionId: sess.sessionId,
  commands: [{ name: "telegram", description: "Telegram bridge" }],
  hooks: true,
});

sess.on("command.execute", (event) => {
  const { requestId, commandName, args } = event.data;
  if (commandName !== "telegram") return;
  // handle command...
});

Then in Copilot CLI:

  1. start the CLI with the extension loaded
  2. run /telegram

Actual behavior

Copilot CLI displays an unknown command style error, but the extension still receives and executes the command correctly.

So the command both:

  • appears unknown in the UI
  • and still works as intended

Expected behavior

One of these should happen consistently:

  1. the command is recognized normally with no error, or
  2. if dynamically added commands are not supported in this way, the command should not execute either

Notes

This seems related to extension commands being added after startup rather than being available in the initial command set.

In this case, the extension uses session.resume because joinSession(...) does not expose a direct way to provide slash commands up front.

That makes this look like either:

  • a bug in Copilot CLI command discovery/validation for extension-added commands, or
  • a gap in the extension API contract around dynamic slash-command registration.

If helpful, I can provide a reduced repro extension.

Activity

  1. added
    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents
    on Apr 16, 2026
  2. added theissue type on Apr 16, 2026
  3. patniko commented on Oct 26, 2026

    @patniko
    Collaborator

    Thanks for the report. We've shipped fixes in this area since this was filed, and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.

    Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

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

    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agentsmore-info-needed

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions