gcai chat create and gcai playbooks run. The CLI handles the waiting for you.
Wait by default
chat create and playbooks run submit the job, poll it to completion, and print the finished result. You do not need to run a separate poll loop. If the job ends in an error, the command exits non-zero with the error message.
Polling a job yourself
If you used--async (or want to check on a job later), poll it with jobs get:
gcai jobs get keeps its own --wait <seconds> for a single server-side long-poll. Re-run it until status is succeeded, failed, or canceled.