diff --git a/nix/opencode/plugins/github-agents.js b/nix/opencode/plugins/github-agents.js index fac06b4..7d9fb63 100644 --- a/nix/opencode/plugins/github-agents.js +++ b/nix/opencode/plugins/github-agents.js @@ -268,13 +268,16 @@ async function fetchValidModelIds(client, providerId) { } function toAgent(data, body, fallbackName) { - const rawName = data.name || fallbackName - const name = slugify(rawName) + // Name comes from the FILENAME (planner.agent.md -> "planner"), not the + // frontmatter `name:` — Copilot files tend to use a short filename and a + // long descriptive `name:`, and the filename is the nicer @mention handle. + const name = slugify(fallbackName) if (!name) return null const agent = { description: (data.description && String(data.description)) || - `GitHub Copilot agent "${rawName}"`, + (data.name && `GitHub Copilot agent "${data.name}"`) || + `GitHub Copilot agent "${fallbackName}"`, mode: DEFAULT_MODE, prompt: body.trim(), }