···11671167 }
1168116811691169 let family = config.capabilities?.family?.lowercased() ?? ""
11701170+ // Fall back to `source_model.architecture` when `capabilities.family` is
11711171+ // absent. Some ZAYA bundles (e.g. ZAYA1-VL JANGTQ) stamp only
11721172+ // `source_model.architecture = zaya1_vl` and omit `capabilities.family`;
11731173+ // without this fallback the tool-aware template never materializes, the
11741174+ // bare role-only template is used, and the model leaks raw `<tool_call>`
11751175+ // XML as visible text. The contract stays data-driven (parser +
11761176+ // think_in_template + supports_tools), just not family-name-only.
11771177+ let arch = config.sourceModel.architecture.lowercased()
11701178 let parser = config.capabilities?.toolParser?.lowercased() ?? ""
11711179 let supportsTools = config.capabilities?.supportsTools
11721172- let isZayaText = family == "zaya"
11731173- || family == "zaya1"
11741174- || family.hasPrefix("zaya1_")
11751175- || family.hasPrefix("zaya1-")
11801180+ func isZayaIdent(_ s: String) -> Bool {
11811181+ s == "zaya" || s == "zaya1" || s.hasPrefix("zaya1_") || s.hasPrefix("zaya1-")
11821182+ }
11831183+ let isZayaText = isZayaIdent(family) || isZayaIdent(arch)
11761184 return isZayaText
11771185 && ["zaya", "zaya_xml", "zyphra", "zyphra_xml"].contains(parser)
11781186 && config.capabilities?.thinkInTemplate == false
···11851193 }
1186119411871195 let family = config.capabilities?.family?.lowercased() ?? ""
11961196+ // Same architecture fallback as the text gate: ZAYA1-VL JANGTQ bundles
11971197+ // stamp `source_model.architecture = zaya1_vl` without a `capabilities.family`.
11981198+ let arch = config.sourceModel.architecture.lowercased()
11881199 let parser = config.capabilities?.toolParser?.lowercased() ?? ""
11891200 let supportsTools = config.capabilities?.supportsTools
11901190- return family.contains("zaya1_vl")
12011201+ return (family.contains("zaya1_vl") || arch.contains("zaya1_vl"))
11911202 && ["zaya", "zaya_xml", "zyphra", "zyphra_xml"].contains(parser)
11921203 && config.capabilities?.thinkInTemplate == false
11931204 && supportsTools != false