File tree Expand file tree Collapse file tree 4 files changed +13
-3
lines changed
Expand file tree Collapse file tree 4 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ await Promise.all([
3030 fs . mkdir ( Global . Path . bin , { recursive : true } ) ,
3131] )
3232
33- const CACHE_VERSION = "10 "
33+ const CACHE_VERSION = "11 "
3434
3535const version = await Bun . file ( path . join ( Global . Path . cache , "version" ) )
3636 . text ( )
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export namespace Plugin {
2828 }
2929 const plugins = [ ...( config . plugin ?? [ ] ) ]
3030 if ( ! Flag . OPENCODE_DISABLE_DEFAULT_PLUGINS ) {
31- plugins . push ( "opencode-copilot-auth@0.0.5 " )
31+ plugins . push ( "opencode-copilot-auth@0.0.7 " )
3232 plugins . push ( "opencode-anthropic-auth@0.0.2" )
3333 }
3434 for ( let plugin of plugins ) {
Original file line number Diff line number Diff line change @@ -272,4 +272,12 @@ export namespace ProviderTransform {
272272
273273 return schema
274274 }
275+
276+ export function error ( providerID : string , message : string ) {
277+ if ( providerID === "github-copilot" && message . includes ( "The requested model is not supported" ) ) {
278+ message +=
279+ "\n\nMake sure the model is enabled in your copilot settings: https://github.com/settings/copilot/features"
280+ }
281+ return message
282+ }
275283}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { LSP } from "../lsp"
88import { Snapshot } from "@/snapshot"
99import { fn } from "@/util/fn"
1010import { Storage } from "@/storage/storage"
11+ import { ProviderTransform } from "@/provider/transform"
1112
1213export namespace MessageV2 {
1314 export const OutputLengthError = NamedError . create ( "MessageOutputLengthError" , z . object ( { } ) )
@@ -737,9 +738,10 @@ export namespace MessageV2 {
737738 { cause : e } ,
738739 ) . toObject ( )
739740 case APICallError . isInstance ( e ) :
741+ const message = ProviderTransform . error ( ctx . providerID , e . message )
740742 return new MessageV2 . APIError (
741743 {
742- message : e . message ,
744+ message,
743745 statusCode : e . statusCode ,
744746 isRetryable : e . isRetryable ,
745747 responseHeaders : e . responseHeaders ,
You can’t perform that action at this time.
0 commit comments