Skip to content

fix(opencode): resolve opencodeModel "inherit" on all structured-output paths#195

Open
anagnorisis2peripeteia wants to merge 1 commit into
tickernelz:mainfrom
anagnorisis2peripeteia:fix/inherit-all-opencode-paths
Open

fix(opencode): resolve opencodeModel "inherit" on all structured-output paths#195
anagnorisis2peripeteia wants to merge 1 commit into
tickernelz:mainfrom
anagnorisis2peripeteia:fix/inherit-all-opencode-paths

Conversation

@anagnorisis2peripeteia

@anagnorisis2peripeteia anagnorisis2peripeteia commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

opencodeModel: "inherit" (from #151) only expanded to a concrete model on the auto-capture path. Profile learning, conflict/dedup checks, description evolution, and other generateStructuredOutput callers still sent modelID: "inherit" to OpenCode, which fails with:

ProviderModelNotFoundError: Model not found: local/inherit

(and the same shape for any configured provider).

This expands inherit centrally inside generateStructuredOutput:

  1. Prefer a prompt-recorded model when provided (auto-capture / chat.params)
  2. Else fall back to the most recent entry in OpenCode's model.json for the configured provider
  3. Else throw a clear configuration error instead of a provider lookup failure

Test plan

  • bun test tests/opencode-provider.test.ts (26 pass, including 5 new inherit cases)
  • With "opencodeModel": "inherit" configured, trigger profile learning / auto-capture and confirm no Model not found: <provider>/inherit toasts
  • Confirm capture still prefers the per-prompt recorded model when chat.params has run

…ut paths

Auto-capture already expanded "inherit" from the chat.params-recorded
session model. Profile learning, conflict/dedup checks, and other
generateStructuredOutput callers still forwarded modelID="inherit"
literally, producing ProviderModelNotFoundError: Model not found:
local/inherit (and the same for other providers).

Resolve inherit centrally in generateStructuredOutput: prefer a recorded
prompt model, else fall back to OpenCode's recent model.json entry for
the configured provider. Document the behavior and lock it in with tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant