
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given the function $f(x)=\cos 2x+a\sin x+b$ where $a \lt 0$.  
$(1)$ If the maximum value of $f(x)$ is $\frac{9}{8}$ and the minimum value is $-2$ when $x\in R$, find the values of real numbers $a$ and $b$.  
$(2)$ If $a=-2$ and $b=1$, and the function $g(x)=m\sin x+2m$ where $x\in[\frac{\pi}{6},\frac{2\pi}{3}]$, and $f(x) \gt g(x)$ always holds, find the range of real number $m$.

Present the answer in LaTex format: \boxed{Your answer}
user