fix: display MCP tag for prompts in autocomplete but not in prompt (#6531)

This commit is contained in:
Paolo Ricciuti
2025-12-31 16:34:36 +01:00
committed by GitHub
parent 6e3ead198e
commit 5249f04ea0
5 changed files with 8 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ export namespace Command {
description: z.string().optional(),
agent: z.string().optional(),
model: z.string().optional(),
mcp: z.boolean().optional(),
// workaround for zod not supporting async functions natively so we use getters
// https://zod.dev/v4/changelog?id=zfunction
template: z.promise(z.string()).or(z.string()),
@@ -94,6 +95,7 @@ export namespace Command {
for (const [name, prompt] of Object.entries(await MCP.prompts())) {
result[name] = {
name,
mcp: true,
description: prompt.description,
get template() {
// since a getter can't be async we need to manually return a promise here