Skip to main content

Module copilot_agent_sessions

Module copilot_agent_sessions 

Source
Expand description

The Copilot agent session API: the session document and its log.

These endpoints are undocumented and read-only. They live on the Copilot API host, which GraphQL names (viewer { copilotEndpoints { api } }), so nothing here hardcodes a host. They accept the gh CLI OAuth token only, so a run with GH_TOKEN, GITHUB_TOKEN or a config-file token is told what it needs rather than being sent to GitHub with a token that fails.

Structs§

CopilotAgentSession
One Copilot agent session, as the Copilot API describes it. It carries the fields the REST task detail does not: the pull request number and state, the workflow run, and the prompt the session was given.
SessionLog
A parsed session log.

Enums§

LogEntry
One entry of a parsed session log, in the order the log holds them.

Constants§

MAX_LOG_BYTES
The most of one log Subspace ever reads. A finished session’s log is 240-730 KB, so this leaves room without letting one answer grow freely.

Functions§

needs_oauth_login
What the user must do when the work credential is not an OAuth token, naming Sign in with GitHub only when the app offers it.
parse_log
The parsed log of an event stream. truncated says the read hit its cap.