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
retryCount in format.json_schema breaks structured output on opencode >=1.18 (HTTP 400 "Upstream request failed") #226
retryCount is a field of opencode's OutputFormatJsonSchema type, not a top-level sibling of type/schema. opencode's request-body schema validator rejects the payload with HTTP 400 before any provider is contacted.
Impact
opencodeProvider / opencodeModel auto-capture always fails → falls back to "External API not configured" (for users who rely on the opencode path, capture silently never works).
Error message is misleading ("Error from provider … Upstream request failed"), making the true cause hard to find.
Steps to reproduce
opencode 1.18.10, opencode-mem 2.22.2.
Set opencodeProvider + opencodeModel (e.g. "opencode-go" + "deepseek-v4-flash").
Trigger auto-capture (idle session).
Observe the HTTP 400 and the schema rejection WARN in ~/.local/share/opencode/log/opencode.log.
Suggested fix
Remove retryCount from the format object (or place it inside the schema per opencode's OutputFormatJsonSchema definition). Workaround that avoids this entirely: configure the manual provider path (memoryProvider: "openai-chat" with an OpenAI-compatible endpoint).
Thanks for the detailed report. We verified this against OpenCode 1.18.10 using otherwise identical structured-output requests with and without retryCount.
Both payloads were accepted and reached the provider; removing retryCount did not change the result. OpenCode’s schema also explicitly defines retryCount as a valid top-level field of OutputFormatJsonSchema.
The underlying structured-output handling is tracked upstream:
Since removing retryCount in opencode-mem would not fix the underlying failure and would only remove a valid API field, we will not apply a workaround here. Closing this issue as an upstream OpenCode problem.
Activity
EyJunge1 commentedon Aug 2, 2026
Thanks for the detailed report. We verified this against OpenCode 1.18.10 using otherwise identical structured-output requests with and without
retryCount.Both payloads were accepted and reached the provider; removing
retryCountdid not change the result. OpenCode’s schema also explicitly definesretryCountas a valid top-level field ofOutputFormatJsonSchema.The underlying structured-output handling is tracked upstream:
Since removing
retryCountin opencode-mem would not fix the underlying failure and would only remove a valid API field, we will not apply a workaround here. Closing this issue as an upstream OpenCode problem.