MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / partialTimeoutText

Method partialTimeoutText

agent/subagent.go:405–419  ·  view source on GitHub ↗
(sessionState *SubAgentSessionState, currentText string)

Source from the content-addressed store, hash-verified

403}
404
405func (s *SubAgent) partialTimeoutText(sessionState *SubAgentSessionState, currentText string) string {
406 var sections []string
407 if strings.TrimSpace(currentText) != "" {
408 sections = append(sections, "Partial assistant text:\n"+strings.TrimSpace(currentText))
409 } else if text := latestAssistantText(sessionState.Messages); text != "" {
410 sections = append(sections, "Latest assistant text:\n"+text)
411 }
412 if observations := formatRecentSubagentObservations(sessionState.RecentToolObservations, 6); len(observations) > 0 {
413 sections = append(sections, "Recent tool observations:\n"+strings.Join(observations, "\n"))
414 }
415 if len(sections) == 0 {
416 sections = append(sections, "No text or tool observations were produced before the timeout.")
417 }
418 return fmt.Sprintf("Sub-agent reached its %ds timeout and is returning partial progress instead of a tool error.\n\n%s", s.timeoutSeconds(), strings.Join(sections, "\n\n"))
419}
420
421func (s *SubAgent) wrapTimedOutResult(text string) string {
422 text = strings.TrimSpace(text)

Callers 1

contextStopResultMethod · 0.95

Calls 3

timeoutSecondsMethod · 0.95
latestAssistantTextFunction · 0.85

Tested by

no test coverage detected