cli/cli · error
session ID is required when not running interactively
Error message
session ID is required when not running interactively
What it means
Error "session ID is required when not running interactively" thrown in cli/cli.
Source
Thrown at pkg/cmd/agent-task/view/view.go:105
# View a pull request agents tasks in the browser
$ gh agent-task view 12345 --web
`),
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
// Support -R/--repo override
opts.BaseRepo = f.BaseRepo
if len(args) > 0 {
opts.SelectorArg = args[0]
if shared.IsSessionID(opts.SelectorArg) {
opts.SessionID = opts.SelectorArg
} else if sessionID, err := shared.ParseSessionIDFromURL(opts.SelectorArg); err == nil {
opts.SessionID = sessionID
}
}
if opts.SessionID == "" && !opts.IO.CanPrompt() {
return fmt.Errorf("session ID is required when not running interactively")
}
if opts.Follow && !opts.Log {
return cmdutil.FlagErrorf("--log is required when providing --follow")
}
if opts.Finder == nil {
opts.Finder = prShared.NewFinder(f)
}
if runF != nil {
return runF(opts)
}
return viewRun(opts)
},
}
cmdutil.EnableRepoOverride(cmd, f)View on GitHub (pinned to 0eeec0b92e)
Solutions
- Pass the session ID explicitly (e.g. `gh agent-task view <session-id>`), or run the command in an interactive terminal to pick a session.
When it happens
Trigger: Thrown at pkg/cmd/agent-task/view/view.go:105 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cli/cli@0eeec0b92e (2026-08-15).
Data as JSON: /api/errors/c692b67a42835d61.
Report an issue: GitHub.