(text string)
| 419 | } |
| 420 | |
| 421 | func (s *SubAgent) wrapTimedOutResult(text string) string { |
| 422 | text = strings.TrimSpace(text) |
| 423 | if text == "" { |
| 424 | text = "No final text was produced before the timeout." |
| 425 | } |
| 426 | return fmt.Sprintf("[Sub-agent timeout]\nThis sub-agent reached its %d second timeout. The answer below is based only on information already collected before timeout. If this is insufficient, the main agent may ask this sub-agent, or a narrower follow-up sub-agent, to continue querying from a more focused prompt.\n\n%s", s.timeoutSeconds(), text) |
| 427 | } |
| 428 | |
| 429 | func latestAssistantText(messages []map[string]any) string { |
| 430 | for i := len(messages) - 1; i >= 0; i-- { |
no test coverage detected