Skip to content

Commit 661817d

Browse files
committed
fix(agent-task view): omit session overview in log mode
Signed-off-by: Babak K. Shandiz <babakks@github.com>
1 parent 99a6161 commit 661817d

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

pkg/cmd/agent-task/view/view.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ func viewRun(opts *ViewOptions) error {
277277
}
278278
}
279279

280-
printSession(opts, session)
281-
282280
if opts.Log {
283281
return printLogs(opts, capiClient, session.ID)
284282
}
283+
284+
printSession(opts, session)
285285
return nil
286286
}
287287

@@ -362,7 +362,6 @@ func printLogs(opts *ViewOptions, capiClient capi.CapiClient, sessionID string)
362362
return raw, nil
363363
}
364364

365-
fmt.Fprintln(opts.IO.Out, "")
366365
return renderer.Follow(fetcher, opts.IO.Out, opts.IO)
367366
}
368367

@@ -371,7 +370,6 @@ func printLogs(opts *ViewOptions, capiClient capi.CapiClient, sessionID string)
371370
return fmt.Errorf("failed to fetch session logs: %w", err)
372371
}
373372

374-
fmt.Fprintln(opts.IO.Out, "")
375373
_, err = renderer.Render(raw, opts.IO.Out, opts.IO)
376374
return err
377375
}

pkg/cmd/agent-task/view/view_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -932,13 +932,6 @@ func Test_viewRun(t *testing.T) {
932932
}
933933
},
934934
wantOut: heredoc.Doc(`
935-
Ready for review
936-
Started on behalf of octocat about 6 hours ago
937-
Used 1.5 premium request(s) • Duration 5m0s
938-
939-
To follow session logs, try:
940-
gh agent-task view 'some-session-id' --log --follow
941-
942935
(rendered:) <raw-logs>
943936
`),
944937
},
@@ -992,10 +985,6 @@ func Test_viewRun(t *testing.T) {
992985
}
993986
},
994987
wantOut: heredoc.Doc(`
995-
Ready for review
996-
Started on behalf of octocat about 6 hours ago
997-
Used 1.5 premium request(s) • Duration 5m0s
998-
999988
(rendered:) <raw-logs-one>
1000989
(rendered:) <raw-logs-two>
1001990
`),

0 commit comments

Comments
 (0)