Patched Jinja template for Qwen 3.5 27B - fixes developer role crash + preserves thinking mode (thinking = 1). Drop-in replacement for agent tools (OpenCode, Claude Code, Continue, Cursor, Aider). This is a patched Jinja template for the Qwen 3.5 27B model that fixes a crash when using the "developer" role and preserves the model's thinking mode (thinking=1). It serves as a drop-in replacement for agent tools like OpenCode, Claude Code, Continue, Cursor, and Aider, addressing an issue where using the standard `--chat-template chatml` would silently disable thinking mode. - - Save sudoingX/c2facf7d8f7608c65c1024ef3b22d431 to your computer and use it in GitHub Desktop. Learn more about bidirectional Unicode characters https://github.co/hiddenchars | {%- set image count = namespace value=0 %} | | | {%- set video count = namespace value=0 %} | | | {%- macro render content content, do vision count, is system content=false %} | | | {%- if content is string %} | | | {{- content }} | | | {%- elif content is iterable and content is not mapping %} | | | {%- for item in content %} | | | {%- if 'image' in item or 'image url' in item or item.type == 'image' %} | | | {%- if is system content %} | | | {{- raise exception 'System message cannot contain images.' }} | | | {%- endif %} | | | {%- if do vision count %} | | | {%- set image count.value = image count.value + 1 %} | | | {%- endif %} | | | {%- if add vision id %} | | | {{- 'Picture ' ~ image count.value ~ ': ' }} | | | {%- endif %} | | | {{- '<|vision start| <|image pad| <|vision end| ' }} | | | {%- elif 'video' in item or item.type == 'video' %} | | | {%- if is system content %} | | | {{- raise exception 'System message cannot contain videos.' }} | | | {%- endif %} | | | {%- if do vision count %} | | | {%- set video count.value = video count.value + 1 %} | | | {%- endif %} | | | {%- if add vision id %} | | | {{- 'Video ' ~ video count.value ~ ': ' }} | | | {%- endif %} | | | {{- '<|vision start| <|video pad| <|vision end| ' }} | | | {%- elif 'text' in item %} | | | {{- item.text }} | | | {%- else %} | | | {{- raise exception 'Unexpected item type in content.' }} | | | {%- endif %} | | | {%- endfor %} | | | {%- elif content is none or content is undefined %} | | | {{- '' }} | | | {%- else %} | | | {{- raise exception 'Unexpected content type.' }} | | | {%- endif %} | | | {%- endmacro %} | | | {%- if not messages %} | | | {{- raise exception 'No messages provided.' }} | | | {%- endif %} | | | {%- if tools and tools is iterable and tools is not mapping %} | | | {{- '<|im start| system\n' }} | | | {{- " Tools\n\nYou have access to the following functions:\n\n