| 104 | } |
| 105 | |
| 106 | func shouldRunCompileUpdateCheck(noCheckUpdate bool) bool { |
| 107 | if noCheckUpdate { |
| 108 | compileUpdateCheckLog.Print("Update check disabled via --no-check-update flag") |
| 109 | return false |
| 110 | } |
| 111 | if os.Getenv(compileUpdateCheckDisableEnv) != "" { |
| 112 | compileUpdateCheckLog.Printf("Update check disabled via %s", compileUpdateCheckDisableEnv) |
| 113 | return false |
| 114 | } |
| 115 | if IsRunningInCI() { |
| 116 | compileUpdateCheckLog.Print("Update check disabled in CI environment") |
| 117 | return false |
| 118 | } |
| 119 | if isRunningAsMCPServer() { |
| 120 | compileUpdateCheckLog.Print("Update check disabled in MCP server mode") |
| 121 | return false |
| 122 | } |
| 123 | if !compileUpdateCheckIsTerminalFunc() { |
| 124 | compileUpdateCheckLog.Print("Update check disabled when stderr is not a terminal") |
| 125 | return false |
| 126 | } |
| 127 | |
| 128 | lastCheckFile := getCompileUpdateCheckFilePath() |
| 129 | return shouldRunUpdateCheckAtPath(lastCheckFile, compileUpdateCheckInterval, "compile update check", compileUpdateCheckLog) |
| 130 | } |
| 131 | |
| 132 | func waitForCompileUpdateNotification(ctx context.Context, results <-chan *compileUpdateNotification, timeout time.Duration) *compileUpdateNotification { |
| 133 | if results == nil { |