waitForCompletion waits for the agent to finish processing
(ctx context.Context, ag *agent.Agent)
| 414 | |
| 415 | // waitForCompletion waits for the agent to finish processing |
| 416 | func waitForCompletion(ctx context.Context, ag *agent.Agent) { |
| 417 | for { |
| 418 | select { |
| 419 | case <-ctx.Done(): |
| 420 | return |
| 421 | case <-time.After(100 * time.Millisecond): |
| 422 | status := ag.Status() |
| 423 | if status.State == types.AgentStateReady { |
| 424 | return |
| 425 | } |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | // printWelcome prints the welcome message |
| 431 | func printWelcome(useColor bool, modelConfig *types.ModelConfig, recipeConfig *recipe.Recipe, workDir, sessionID string) { |