From 661817de50d1561077ea615c73f27f2620e2f7f8 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Wed, 17 Sep 2025 13:59:13 +0100 Subject: [PATCH] fix(agent-task view): omit session overview in log mode Signed-off-by: Babak K. Shandiz --- pkg/cmd/agent-task/view/view.go | 6 ++---- pkg/cmd/agent-task/view/view_test.go | 11 ----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/pkg/cmd/agent-task/view/view.go b/pkg/cmd/agent-task/view/view.go index c7474c12d..b751201db 100644 --- a/pkg/cmd/agent-task/view/view.go +++ b/pkg/cmd/agent-task/view/view.go @@ -277,11 +277,11 @@ func viewRun(opts *ViewOptions) error { } } - printSession(opts, session) - if opts.Log { return printLogs(opts, capiClient, session.ID) } + + printSession(opts, session) return nil } @@ -362,7 +362,6 @@ func printLogs(opts *ViewOptions, capiClient capi.CapiClient, sessionID string) return raw, nil } - fmt.Fprintln(opts.IO.Out, "") return renderer.Follow(fetcher, opts.IO.Out, opts.IO) } @@ -371,7 +370,6 @@ func printLogs(opts *ViewOptions, capiClient capi.CapiClient, sessionID string) return fmt.Errorf("failed to fetch session logs: %w", err) } - fmt.Fprintln(opts.IO.Out, "") _, err = renderer.Render(raw, opts.IO.Out, opts.IO) return err } diff --git a/pkg/cmd/agent-task/view/view_test.go b/pkg/cmd/agent-task/view/view_test.go index 08ffaa1ba..d39ac0a41 100644 --- a/pkg/cmd/agent-task/view/view_test.go +++ b/pkg/cmd/agent-task/view/view_test.go @@ -932,13 +932,6 @@ func Test_viewRun(t *testing.T) { } }, wantOut: heredoc.Doc(` - Ready for review - Started on behalf of octocat about 6 hours ago - Used 1.5 premium request(s) • Duration 5m0s - - To follow session logs, try: - gh agent-task view 'some-session-id' --log --follow - (rendered:) `), }, @@ -992,10 +985,6 @@ func Test_viewRun(t *testing.T) { } }, wantOut: heredoc.Doc(` - Ready for review - Started on behalf of octocat about 6 hours ago - Used 1.5 premium request(s) • Duration 5m0s - (rendered:) (rendered:) `),