(logsPath string)
| 190 | } |
| 191 | |
| 192 | func findAgentStdioLogPath(logsPath string) string { |
| 193 | root := filepath.Join(logsPath, "agent-stdio.log") |
| 194 | if fileutil.FileExists(root) { |
| 195 | return root |
| 196 | } |
| 197 | |
| 198 | var found string |
| 199 | walkErr := filepath.Walk(logsPath, func(path string, info os.FileInfo, err error) error { |
| 200 | if err != nil || info == nil || info.IsDir() { |
| 201 | return nil |
| 202 | } |
| 203 | if info.Name() == "agent-stdio.log" { |
| 204 | found = path |
| 205 | return filepath.SkipAll |
| 206 | } |
| 207 | return nil |
| 208 | }) |
| 209 | if walkErr != nil && !errors.Is(walkErr, filepath.SkipAll) { |
| 210 | auditExpandedLog.Printf("Failed while searching for agent-stdio.log in %s: %v", logsPath, walkErr) |
| 211 | } |
| 212 | return found |
| 213 | } |
| 214 | |
| 215 | func hasUsefulFallbackMetrics(metrics LogMetrics) bool { |
| 216 | return metrics.TokenUsage > 0 || metrics.Turns > 0 || len(metrics.ToolCalls) > 0 |
no test coverage detected