fix(agent-task view): omit session overview in log mode

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2025-09-17 13:59:13 +01:00
parent 99a61618df
commit 661817de50
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E
2 changed files with 2 additions and 15 deletions

View file

@ -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
}

View file

@ -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:) <raw-logs>
`),
},
@ -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:) <raw-logs-one>
(rendered:) <raw-logs-two>
`),