Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/opencode/src/global/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ await Promise.all([
fs.mkdir(Global.Path.bin, { recursive: true }),
])

const CACHE_VERSION = "10"
const CACHE_VERSION = "11"

const version = await Bun.file(path.join(Global.Path.cache, "version"))
.text()
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode/src/plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export namespace Plugin {
}
const plugins = [...(config.plugin ?? [])]
if (!Flag.OPENCODE_DISABLE_DEFAULT_PLUGINS) {
plugins.push("[email protected].5")
plugins.push("[email protected].7")
plugins.push("[email protected]")
}
for (let plugin of plugins) {
Expand Down
8 changes: 8 additions & 0 deletions packages/opencode/src/provider/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,12 @@ export namespace ProviderTransform {

return schema
}

export function error(providerID: string, message: string) {
if (providerID === "github-copilot" && message.includes("The requested model is not supported")) {
message +=
"\n\nMake sure the model is enabled in your copilot settings: https://github.com/settings/copilot/features"
}
return message
}
}
4 changes: 3 additions & 1 deletion packages/opencode/src/session/message-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { LSP } from "../lsp"
import { Snapshot } from "@/snapshot"
import { fn } from "@/util/fn"
import { Storage } from "@/storage/storage"
import { ProviderTransform } from "@/provider/transform"

export namespace MessageV2 {
export const OutputLengthError = NamedError.create("MessageOutputLengthError", z.object({}))
Expand Down Expand Up @@ -737,9 +738,10 @@ export namespace MessageV2 {
{ cause: e },
).toObject()
case APICallError.isInstance(e):
const message = ProviderTransform.error(ctx.providerID, e.message)
return new MessageV2.APIError(
{
message: e.message,
message,
statusCode: e.statusCode,
isRetryable: e.isRetryable,
responseHeaders: e.responseHeaders,
Expand Down