@@ -40,8 +40,8 @@ func runSimulateTUI(config *simulateConfig) error {
4040 _ , runErr := p .Run ()
4141
4242 if m .launcher != nil {
43- // A second ctrl+c during cleanup would kill the CLI and leak the worker
44- // (own process group, port stays bound); escalate to SIGKILL instead.
43+ // A second ctrl+c during cleanup would kill the CLI and leak the worker
44+ // (own process group, port stays bound); escalate to SIGKILL instead.
4545 sigCh := make (chan os.Signal , 1 )
4646 signal .Notify (sigCh , os .Interrupt )
4747 defer signal .Stop (sigCh )
@@ -157,6 +157,7 @@ type simulateModel struct {
157157
158158 // Run phase
159159 run * livekit.SimulationRun
160+ summary * livekit.SimulationRunSummary
160161 runFinished bool
161162 brokenAgent bool
162163 numSimulations int32
@@ -362,6 +363,7 @@ func (m *simulateModel) runSetup() tea.Cmd {
362363 m .err = err
363364 }
364365 m .run = run
366+ m .summary = decodeRunSummary (run )
365367 m .setupDone = true
366368 return nil
367369 }
@@ -575,6 +577,7 @@ func (m *simulateModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
575577 case simulationRunMsg :
576578 if msg .err == nil && msg .run != nil {
577579 m .run = msg .run
580+ m .summary = decodeRunSummary (msg .run )
578581 m .reporter .RunUpdate (msg .run , m .config .numSimulations )
579582 if m .startTime .IsZero () && msg .run .Status == livekit .SimulationRun_STATUS_RUNNING {
580583 m .startTime = time .Now ()
@@ -1101,7 +1104,7 @@ func (m *simulateModel) viewRunning() string {
11011104
11021105 if m .run .Status == livekit .SimulationRun_STATUS_SUMMARIZING {
11031106 fmt .Fprintf (& b , "\n %s %s %s\n " , yellowStyle ().Render ("⏺" ), yellowStyle ().Render ("Generating summary..." ), m .spinner ())
1104- } else if m .run . Summary != nil {
1107+ } else if m .summary != nil {
11051108 b .WriteString (m .renderSummary ())
11061109 } else if isTerminalRunStatus (m .run .Status ) {
11071110 msg := "The summary for this run is not available"
@@ -1553,7 +1556,7 @@ func (m *simulateModel) scrolledDetail() string {
15531556}
15541557
15551558func (m * simulateModel ) renderSummary () string {
1556- summary := m .run . Summary
1559+ summary := m .summary
15571560 if summary == nil {
15581561 return ""
15591562 }
@@ -1622,10 +1625,10 @@ func (m *simulateModel) renderSummary() string {
16221625}
16231626
16241627func (m * simulateModel ) renderChatTranscript (jobID string ) string {
1625- if m .run . Summary == nil || m .run . Summary .ChatHistory == nil {
1628+ if m .summary == nil || m .summary .ChatHistory == nil {
16261629 return ""
16271630 }
1628- chatCtx , ok := m .run . Summary .ChatHistory [jobID ]
1631+ chatCtx , ok := m .summary .ChatHistory [jobID ]
16291632 if ! ok || chatCtx == nil || len (chatCtx .Items ) == 0 {
16301633 return ""
16311634 }
0 commit comments