
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
Let $a\in \mathbb{R}$, and the graph of the function $f\left(x\right)=ax-1+e^{x}$ is tangent to the line $2x-y=0$, where $e$ is the base of the natural logarithm.  
$(1)$ Find the value of the real number $a$.  
$(2)$ For $x\in[0,\frac{\pi}{2})$, if $f\left(x\right)\geqslant m\sin 2x$ always holds, find the range of the real number $m$.

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