diff --git a/cmd/lk/simulate_ci.go b/cmd/lk/simulate_ci.go index d40182fe..845b2e7c 100644 --- a/cmd/lk/simulate_ci.go +++ b/cmd/lk/simulate_ci.go @@ -271,7 +271,7 @@ func writeRunResults(w io.Writer, run *livekit.SimulationRun, ap *AgentProcess) if run.Summary != nil { writeRunSummary(w, run) } else { - msg := "The summary for this run is not available" + msg := "The summary and chat transcripts for this run are not available yet" if run.Error != "" { msg = run.Error } diff --git a/cmd/lk/simulate_tui.go b/cmd/lk/simulate_tui.go index 10ac812d..76a457a1 100644 --- a/cmd/lk/simulate_tui.go +++ b/cmd/lk/simulate_tui.go @@ -69,6 +69,16 @@ func runSimulateTUI(config *simulateConfig) error { } } + // The summary (which carries the chat transcripts) may have landed after + // the TUI's last poll; refresh once so the report includes it. + if m.run != nil && m.run.Summary == nil && m.runID != "" { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + if run, err := getSimulationRun(ctx, config.client, m.runID); err == nil && run != nil { + m.run = run + } + cancel() + } + // Always leave a plain-text record of the run, like the agent log. if path := m.reporter.Finish(m.run, m.agent, m.brokenAgent, m.getDashboardURL()); path != "" { out.Statusf("Run report: %s", path)