Bug Description
Summary
Agents authored in one assistant's frontmatter dialect leak that dialect into other targets. OpenCode-style frontmatter (mode: subagent, tools as a {name: bool} map) passes through unchanged to Claude Code, which expects tools as a comma-separated string and has no mode field. The agent installs with frontmatter the target cannot fully parse.
Expected
tools renders in the target's native form. Dialect-only fields are dropped for targets that don't understand them. For Claude Code:
mode and temperature are stripped.
Actual
The OpenCode tools map and mode: subagent write verbatim into the Claude Code agent file. Claude Code reads tools as a string, so the map is malformed, and mode is meaningless. The tool allowlist does not take effect.
Root cause
_generate_agent_with_frontmatter (src/lola/targets/base.py) copies the authored frontmatter and adds only the per-target fields (name, model: inherit for Claude Code and Cursor; mode: subagent for OpenCode). It never normalizes tools or removes fields foreign to the destination dialect.
Proposed Fix
Normalize the tools field on read (accept an OpenCode {name: bool} map, a Claude comma-separated string, or a list), then render per target:
- claude-code / cursor: comma-separated string of enabled tools in Claude tool names, with OpenCode-only
mode and temperature fields stripped.
- opencode:
{name: bool} map (Claude strings convert back to map form).
Steps to Reproduce
-
Author an agent with OpenCode-dialect frontmatter:
---
description: Example agent
mode: subagent
tools:
read: true
bash: true
write: false
---
-
lola install <module> -a claude-code.
-
Inspect the generated .claude/agents/<agent>.md frontmatter.
Component
Target assistants (Claude Code, Cursor, etc.)
Lola Version
No response
Python Version
No response
Operating System
No response
Logs and Error Messages
Additional Context
No response
Bug Description
Summary
Agents authored in one assistant's frontmatter dialect leak that dialect into other targets. OpenCode-style frontmatter (
mode: subagent,toolsas a{name: bool}map) passes through unchanged to Claude Code, which expectstoolsas a comma-separated string and has nomodefield. The agent installs with frontmatter the target cannot fully parse.Expected
toolsrenders in the target's native form. Dialect-only fields are dropped for targets that don't understand them. For Claude Code:modeandtemperatureare stripped.Actual
The OpenCode
toolsmap andmode: subagentwrite verbatim into the Claude Code agent file. Claude Code readstoolsas a string, so the map is malformed, andmodeis meaningless. The tool allowlist does not take effect.Root cause
_generate_agent_with_frontmatter(src/lola/targets/base.py) copies the authored frontmatter and adds only the per-target fields (name,model: inheritfor Claude Code and Cursor;mode: subagentfor OpenCode). It never normalizestoolsor removes fields foreign to the destination dialect.Proposed Fix
Normalize the
toolsfield on read (accept an OpenCode{name: bool}map, a Claude comma-separated string, or a list), then render per target:modeandtemperaturefields stripped.{name: bool}map (Claude strings convert back to map form).Steps to Reproduce
Author an agent with OpenCode-dialect frontmatter:
lola install <module> -a claude-code.Inspect the generated
.claude/agents/<agent>.mdfrontmatter.Component
Target assistants (Claude Code, Cursor, etc.)
Lola Version
No response
Python Version
No response
Operating System
No response
Logs and Error Messages
Additional Context
No response