Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Copilot (ACP) does not expand slash commands because T3 adds a runtime-instructions block #19384

Closedgeirsagberg(GitHub profile, opens in a new tab) opened this issue 3 comments

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. Add a skill that can only be started as a slash command, e.g. .github/skills/repro-skill/SKILL.md in a project:

    ---
    name: repro-skill
    description: Minimal skill for reproducing slash-command expansion.
    disable-model-invocation: true
    ---
    
    Reply with exactly: SKILL_LOADED
  2. Open the project in T3 Code and start a GitHub Copilot (ACP registry) thread.

  3. Send /repro-skill.

Expected behavior

Copilot expands the skill, the same way it does in its own CLI. The reply is SKILL_LOADED.

Actual behavior

The slash command is not expanded. The model gets the text as a normal message, tries its skill tool, and fails with Skill not found: repro-skill. This affects every skill with disable-model-invocation: true, because those can only be started as slash commands.

Cause: resolvePromptParts in packages/provider-acp/src/server/adapter.ts keeps a leading / in the first text block (t3AcpPromptWithInstructions returns early for it). But it always adds a second text block with buildRuntimeInstructions(...). Copilot only expands a slash command when the prompt is a single text block that starts with /.

Standalone repro without T3 Code: this script talks to copilot --acp directly and sends the same prompt in two shapes. Run node repro.mjs <project-dir> with the skill above in the project.

import { spawn } from "node:child_process";

const cwd = process.argv[2];

function run(prompt) {
  return new Promise((resolve) => {
    const p = spawn("copilot", ["--acp", "--stdio"], { stdio: ["pipe", "pipe", "ignore"] });
    let buf = "", text = "";
    const send = (id, method, params) => p.stdin.write(JSON.stringify({ jsonrpc: "2.0", id, method, params }) + "\n");
    const done = () => { p.kill(); resolve(text.trim()); };
    p.stdout.on("data", (d) => {
      buf += d;
      let i;
      while ((i = buf.indexOf("\n")) >= 0) {
        const line = buf.slice(0, i); buf = buf.slice(i + 1);
        let m; try { m = JSON.parse(line); } catch { continue; }
        if (m.id === 1) send(2, "session/new", { cwd, mcpServers: [] });
        else if (m.id === 2) send(3, "session/prompt", { sessionId: m.result.sessionId, prompt });
        else if (m.id === 3 || m.method === "session/request_permission") done();
        else if (m.params?.update?.sessionUpdate === "agent_message_chunk") text += m.params.update.content.text ?? "";
      }
    });
    send(1, "initialize", { protocolVersion: 1, clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false } });
  });
}

const slash = { type: "text", text: "/repro-skill If no skill instructions were loaded, reply NOT_LOADED. Do not run tools." };
const extra = { type: "text", text: "<runtime_info>Extra context block.</runtime_info>" };

console.log("one block:   ", await run([slash]));
console.log("two blocks:  ", await run([slash, extra]));

Output:

one block:    SKILL_LOADED
two blocks:   NOT_LOADED

Copilot still lists the skill in available_commands_update, so the command is known. Only the prompt shape stops it from being expanded.

Possible fix: when the user prompt starts with /, send it as the only text block and leave out the runtime-instructions block for that turn.

Impact

Major degradation or frequent failure

Version or commit

0.0.46-nightly.20261013.3053 (code unchanged on main @ 9688e741)

Environment

macOS, T3 Code desktop (Nightly), GitHub Copilot CLI 1.0.96 via ACP registry

Workaround

Remove disable-model-invocation: true from the skill so the model can load it itself.

  1. Note

    Grok responding on behalf of Julius.

    Confirmed in code on main. t3AcpPromptWithInstructions already skips the instructions prefix when the prompt starts with /, so the intent is clearly to let ACP agents expand slash commands. But resolvePromptParts in packages/provider-acp/src/server/adapter.ts then always adds a second text block from buildRuntimeInstructions(...). Your standalone copilot --acp repro shows that Copilot only expands a slash command when the prompt is a single text block. Because that runtime block is added on every turn, /skill turns never expand.

    This isn't the same as #15606, which is in the Cursor SDK path. It isn't an upstream bug to close either, because T3 controls the prompt shape. Removing disable-model-invocation works for now, but it changes how the skill behaves, so it doesn't count as a fix.

    Likely fix: for prompts that start with /, leave out the runtime-instructions block (or don't add any second text block) on that turn. Thanks for the minimal repro.

  2. juliusmarminge added labelsaccepted

  3. juliusmarminge added labelsbug

  4. juliusmarminge added labelsvia-triage

  5. captainDuckay(GitHub profile, opens in a new tab)commented

    Reproduced on GitHub Copilot CLI 1.0.98 with T3 Code (main @ 2fbd4318). I tested by sending raw session/prompt requests to copilot --acp and asking the model to say whether the /grill-me skill body (disable-model-invocation: true) was in its context:

    Prompt blocksResult
    [text "/grill-me …"]LOADED
    [text " /grill-me …"] (leading whitespace)LOADED
    [text "/grill-me …", text "<runtime_info>…"] (current T3 shape)MISSING
    [text "/grill-me …", image]MISSING on Opus 5.5 (2/2). GPT-6 Sol answered LOADED 3 of 4 times; in the 2 of those runs where I logged tool calls, the model had called the skill tool itself for a different skill (grilling), not a Copilot expansion of /grill-me

    The current T3 shape fails the same way on Claude Opus 5.5 and GPT-6 Sol. Skills that the model is allowed to invoke only look fine because the model loads them itself when it sees /name in the text. Skills with disable-model-invocation: true fail with Skill "<name>" not found.

    Notes on the open fixes:

    • #19393 and #19537 both fix the runtime-block case. Leading whitespace doesn't matter for Copilot, so trimming in #19537 is harmless but not required.
    • Image attachments: I see this was already discussed on #19537, which keeps sending images with commands on purpose because the ACP spec allows content blocks alongside a command. The last row above confirms that Copilot doesn't expand the command in that case, so /skill plus a pasted screenshot will still fail on Copilot after either PR. I only tested text + text and text + image, so I can't say whether Copilot's rule is "exactly one block" in general or whether block order matters. This looks like something to report to Copilot rather than change in T3.

    Probe script used (Node, no deps): it starts copilot --acp, runs initialize → session/new → session/prompt with a JSON array of content blocks from argv, auto-approves permissions, and prints the available_commands_update names, tool calls and the agent reply. Happy to share it if useful.

  6. juliusmarminge closed this

  7. I ran into a separate ACP slash-command discovery issue in T3 Code and wanted to add the finding here because it is related to this report. In packages/provider-acp-registry/src/server/probe.ts, MAX_COMMANDS was 128, so normalizeAcpRegistryCommands truncated the ACP agent command list before the UI could advertise commands beyond the first 128. In my environment the registry returned 141 commands, and $interrogate was omitted from the picker. Raising the cap to 4096 made the command available; the probe test then expected 141 commands and added a safety-ceiling assertion for 5000 inputs truncating to 4096. Recommendation: consider raising/removing the low 128 cap (or otherwise avoid silently dropping valid advertised commands), while retaining a generous explicit bound for safety. This is distinct from the prompt-expansion behavior described in this issue: the command was missing from T3s advertised list, rather than present but failing to expand after selection.

Sign in to join this conversation.