Aiden Cline 2 месяцев назад
Родитель
Сommit
a9a2c23736

+ 3 - 0
packages/opencode/src/cli/upgrade.ts

@@ -10,6 +10,9 @@ export async function upgrade() {
   if (Installation.VERSION === latest) return
 
   if (config.autoupdate === false || Flag.OPENCODE_DISABLE_AUTOUPDATE) {
+    return
+  }
+  if (config.autoupdate === "notify") {
     await Bus.publish(Installation.Event.UpdateAvailable, { version: latest })
     return
   }

+ 6 - 1
packages/opencode/src/config/config.ts

@@ -479,7 +479,12 @@ export namespace Config {
         .boolean()
         .optional()
         .describe("@deprecated Use 'share' field instead. Share newly created sessions automatically"),
-      autoupdate: z.boolean().optional().describe("Automatically update to the latest version"),
+      autoupdate: z
+        .union([z.boolean(), z.literal("notify")])
+        .optional()
+        .describe(
+          "Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications",
+        ),
       disabled_providers: z.array(z.string()).optional().describe("Disable providers that are loaded automatically"),
       enabled_providers: z
         .array(z.string())

+ 2 - 2
packages/sdk/js/src/gen/types.gen.ts

@@ -1021,9 +1021,9 @@ export type Config = {
    */
   autoshare?: boolean
   /**
-   * Automatically update to the latest version
+   * Automatically update to the latest version. Set to true to auto-update, false to disable, or 'notify' to show update notifications
    */
-  autoupdate?: boolean
+  autoupdate?: boolean | "notify"
   /**
    * Disable providers that are loaded automatically
    */

+ 2 - 0
packages/web/src/content/docs/config.mdx

@@ -267,6 +267,8 @@ OpenCode will automatically download any new updates when it starts up. You can
 }
 ```
 
+If you don't want updates but want to be notified when a new version is available, set `autoupdate` to `"notify"`.
+
 ---
 
 ### Formatters