From 406d73ff616a2f82acecd92398e4fcce73f5ce81 Mon Sep 17 00:00:00 2001 From: hongming Date: Sun, 24 May 2026 07:25:57 +0000 Subject: [PATCH] fix(templates): revert templates.go change from #1781 (duplicate of #1777) (#1786) CTO-bypass merge 2026-05-24: revert #1781 templates.go duplicate fix; restore #1777 intended strict-filter. --- workspace-server/internal/handlers/templates.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/workspace-server/internal/handlers/templates.go b/workspace-server/internal/handlers/templates.go index ab1782ab..0cf0e225 100644 --- a/workspace-server/internal/handlers/templates.go +++ b/workspace-server/internal/handlers/templates.go @@ -204,18 +204,9 @@ func (h *TemplatesHandler) List(c *gin.Context) { return } runtime := strings.TrimSuffix(strings.TrimSpace(raw.Runtime), "-default") - // Empty runtime is the legacy / pre-runtime_config shape: those - // templates declare `model:` at the top level and never set - // runtime. TestTemplatesList_LegacyTopLevelModel pins the - // backward-compat contract that they keep surfacing. The - // narrow-catalog filter (a5211050) applies only when a runtime - // is declared — declared runtimes must be in the allowlist; - // absent ones fall through unchanged. - if runtime != "" { - if _, ok := knownRuntimes[runtime]; !ok { - log.Printf("templates list: skip %s: unsupported runtime %q", id, raw.Runtime) - return - } + if _, ok := knownRuntimes[runtime]; !ok { + log.Printf("templates list: skip %s: unsupported runtime %q", id, raw.Runtime) + return } // Model comes from either top-level (legacy) or runtime_config.model (current).