(t *testing.T, rt *agent.AgentTaskRuntime, taskID, scopeID, status string)
| 628 | block, _ := rawBlock.(map[string]any) |
| 629 | if strings.Contains(fmt.Sprint(block["text"]), needle) || strings.Contains(fmt.Sprint(block["content"]), needle) { |
| 630 | return true |
| 631 | } |
| 632 | } |
| 633 | } |
| 634 | } |
| 635 | return false |
| 636 | } |
| 637 | |
| 638 | func waitUntilStatus(t *testing.T, rt *agent.AgentTaskRuntime, taskID, scopeID, status string) { |
| 639 | t.Helper() |
| 640 | deadline := time.Now().Add(3 * time.Second) |
| 641 | for time.Now().Before(deadline) { |
| 642 | record := rt.GetTask(taskID, scopeID) |
| 643 | if record != nil && record.Status == status { |
| 644 | return |
no test coverage detected