Skip to content

Commit e7eaaa3

Browse files
committed
feat: bump ai-sdk-provider-opencode-sdk to ^0.0.3 and wire --opencode hint
- ben-vargas/ai-sdk-provider-opencode-sdk#18 released as v0.0.3 fixes the zod 4 incompat. Bump the dep so OpenCode selection actually works end-to-end - Add OPENCODE case to setModel's providerHint cascade in scripts/modules/task-manager/models.js so --opencode is accepted
1 parent 356b1f6 commit e7eaaa3

3 files changed

Lines changed: 26 additions & 8 deletions

File tree

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"ai-sdk-provider-claude-code": "^2.2.4",
8686
"ai-sdk-provider-codex-cli": "^0.7.0",
8787
"ai-sdk-provider-gemini-cli": "^1.4.0",
88-
"ai-sdk-provider-opencode-sdk": "^0.0.2",
88+
"ai-sdk-provider-opencode-sdk": "^0.0.3",
8989
"ajv": "^8.17.1",
9090
"ajv-formats": "^3.0.1",
9191
"beautiful-mermaid": "^0.1.3",

scripts/modules/task-manager/models.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,24 @@ async function setModel(role, modelId, options = {}) {
617617
warningMessage = `Warning: Codex CLI model '${modelId}' not found in supported models. Setting without validation.`;
618618
report('warn', warningMessage);
619619
}
620+
} else if (providerHint === CUSTOM_PROVIDERS.OPENCODE) {
621+
// OpenCode provider - validate against known models; allow
622+
// unknown IDs since OpenCode's model catalog is dynamic and
623+
// depends on the user's configured backends.
624+
determinedProvider = CUSTOM_PROVIDERS.OPENCODE;
625+
const opencodeModels = availableModels.filter(
626+
(m) => m.provider === 'opencode'
627+
);
628+
const opencodeModelData = opencodeModels.find(
629+
(m) => m.id === modelId
630+
);
631+
if (opencodeModelData) {
632+
modelData = opencodeModelData;
633+
report('info', `Setting OpenCode model '${modelId}'.`);
634+
} else {
635+
warningMessage = `Warning: OpenCode model '${modelId}' not in the curated list. Setting without validation - OpenCode's model catalog is dynamic.`;
636+
report('warn', warningMessage);
637+
}
620638
} else if (providerHint === CUSTOM_PROVIDERS.LMSTUDIO) {
621639
// LM Studio provider - set without validation since it's a local server
622640
determinedProvider = CUSTOM_PROVIDERS.LMSTUDIO;

0 commit comments

Comments
 (0)