GeezerVison is showing github.com — fix(opencode): resolve opencodeModel "inherit" on all structured-output paths by anagnorisis2peripeteia · Pull Request #195 · tickernelz/opencode-mem
Conversation
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:
- Prefer a prompt-recorded model when provided (auto-capture /
chat.params)
- Else fall back to the most recent entry in OpenCode's
model.json for the configured provider
- 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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…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.
Uh oh!
There was an error while loading. Please reload this page.
|
Merged into main and included in the v2.21.0 release tag. Verified on the fully integrated batch tree with bun install --frozen-lockfile, bun run typecheck, bun run build, and bun test (268 pass / 0 fail). Thanks for the contribution!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.