File tree Expand file tree Collapse file tree
packages/opencode/src/plugin/github-copilot Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { Hooks , PluginInput } from "@opencode-ai/plugin"
22import type { Model } from "@opencode-ai/sdk/v2"
3- import { Installation } from "@/installation"
43import { InstallationVersion } from "@/installation/version"
54import { iife } from "@/util/iife"
65import { Log } from "../../util"
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ export const schema = z.object({
1010 // every version looks like: `{model.id}-YYYY-MM-DD`
1111 version : z . string ( ) ,
1212 supported_endpoints : z . array ( z . string ( ) ) . optional ( ) ,
13+ policy : z
14+ . object ( {
15+ state : z . string ( ) . optional ( ) ,
16+ } )
17+ . optional ( ) ,
1318 capabilities : z . object ( {
1419 family : z . string ( ) ,
1520 limits : z . object ( {
@@ -122,7 +127,9 @@ export async function get(
122127 } )
123128
124129 const result = { ...existing }
125- const remote = new Map ( data . data . filter ( ( m ) => m . model_picker_enabled ) . map ( ( m ) => [ m . id , m ] as const ) )
130+ const remote = new Map (
131+ data . data . filter ( ( m ) => m . model_picker_enabled && m . policy ?. state !== "disabled" ) . map ( ( m ) => [ m . id , m ] as const ) ,
132+ )
126133
127134 // prune existing models whose api.id isn't in the endpoint response
128135 for ( const [ key , model ] of Object . entries ( result ) ) {
You can’t perform that action at this time.
0 commit comments