The open source coding agent.
TypeScript
add autoupdate: notify
Aiden Clinea9a2c23736ba
diff --git a/packages/opencode/src/cli/upgrade.ts b/packages/opencode/src/cli/upgrade.tsindex ca5cba27c5a..2bea760b33b 100644--- a/packages/opencode/src/cli/upgrade.ts+++ b/packages/opencode/src/cli/upgrade.ts@@ -10,6 +10,9 @@ export async function upgrade() {if (Installation.VERSION === latest) returnif (config.autoupdate === false || Flag.OPENCODE_DISABLE_AUTOUPDATE) {+ return+ }+ if (config.autoupdate === "notify") {await Bus.publish(Installation.Event.UpdateAvailable, { version: latest })return}diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.tsindex 837899be575..79f969eeaf6 100644--- a/packages/opencode/src/config/config.ts+++ b/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())diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.tsindex e2e611db13a..3ba41cc2390 100644--- a/packages/sdk/js/src/gen/types.gen.ts+++ b/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*/diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdxindex 68f75b7a67a..46d0d82685a 100644--- a/packages/web/src/content/docs/config.mdx+++ b/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