You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Unknown agent frontmatter fields leak into LLM API request body via options #12964
Unknown YAML frontmatter fields in custom agent .md files (e.g. tts, permissions, voice, tags, metadata) are silently collected into agent.options by the .catchall(z.any()).transform() in config.ts. These then get merged into the LLM API request body via mergeDeep(input.agent.options) in llm.ts:111.
Strict API providers (OpenAI, Vertex AI, OpenRouter/Zen) reject the request with errors like Extra inputs are not permitted, causing agents to silently return empty responses.
Root Cause
In packages/opencode/src/config/config.ts (~line 728-732):
constoptions: Record<string,unknown>={ ...agent.options}for(const[key,value]ofObject.entries(agent)){if(!knownKeys.has(key))options[key]=value// ← unknown fields go into options}
Then in llm.ts:111, mergeDeep(input.agent.options) sends them to the API.
Steps to Reproduce
Create a custom agent .md file with any non-standard frontmatter field:
The API request body will contain tts: true and custom_field: "hello"
Strict providers reject the request; the agent returns empty/broken output
Expected Behavior
Only fields explicitly declared under options: in frontmatter should be sent to the LLM API. Unknown fields should be preserved on the agent object (for hooks/plugins) but not merged into API requests.
This issue has been validated and appears to be a root cause analysis for the following related issues. If this is confirmed as the fix, those issues should be marked as duplicates:
Activity
github-actions commentedon Feb 10, 2026
This issue has been validated and appears to be a root cause analysis for the following related issues. If this is confirmed as the fix, those issues should be marked as duplicates:
.opencode/agents/folder agents are giving the<tool_call>response #12950: Agents giving raw<tool_call>responses (likely the same root cause)The detailed root cause analysis and reproduction steps provided here are well-documented and will be helpful for implementing a fix.
fix(config): store unknown agent frontmatter fields in metadata inste…
Steffen025 commentedon Feb 10, 2026
Fix submitted in #12967
rekram1-node commentedon Feb 16, 2026
This is intentional behavior, what purpose do those fields serve for u?
This is also documented:
https://opencode.ai/docs/agents/#additional
github-actions commentedon Apr 18, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.