File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ export namespace Installation {
136136 }
137137
138138 export const VERSION = typeof OPENCODE_VERSION === "string" ? OPENCODE_VERSION : "dev"
139+ export const USER_AGENT = `opencode/${ VERSION } `
139140
140141 export async function latest ( ) {
141142 return fetch ( "https://api.github.com/repos/sst/opencode/releases/latest" )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Log } from "../util/log"
33import path from "path"
44import { z } from "zod"
55import { data } from "./models-macro" with { type : "macro" }
6+ import { Installation } from "../installation"
67
78export namespace ModelsDev {
89 const log = Log . create ( { service : "models.dev" } )
@@ -63,7 +64,7 @@ export namespace ModelsDev {
6364 log . info ( "refreshing" )
6465 const result = await fetch ( "https://models.dev/api.json" , {
6566 headers : {
66- "User-Agent" : "opencode" ,
67+ "User-Agent" : Installation . USER_AGENT ,
6768 } ,
6869 } ) . catch ( ( ) => { } )
6970 if ( result && result . ok ) await Bun . write ( file , result )
You can’t perform that action at this time.
0 commit comments