Add classic workflow to list active agentic task sessions#27615
Merged
Add classic workflow to list active agentic task sessions#27615
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/8eb2605e-1ae8-466c-934b-c2f2832be307 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/8eb2605e-1ae8-466c-934b-c2f2832be307 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
April 21, 2026 16:26
View session
Removed the step that shows the authentication token source.
Contributor
|
✅ Smoke CI completed successfully! |
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a manually triggered GitHub Actions workflow to enumerate and print currently active gh agent-task sessions for the repository.
Changes:
- Introduces a new
workflow_dispatchworkflow for listing agentic task sessions. - Installs/updates the
github/agent-taskGitHub CLI extension at runtime. - Queries sessions via
gh agent-task listand prints those considered “active” based on state filtering.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/agent-task-sessions.yml | New workflow to install gh agent-task and print filtered active session data |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
| - name: Print active agentic task sessions | ||
| run: | | ||
| set -euo pipefail | ||
| active_sessions="$(gh agent-task list --limit 100 --json id,name,state,repository,updatedAt,pullRequestNumber,pullRequestUrl --jq '.[] | select(.state == "open" or .state == "OPEN" or .state == "active" or .state == "ACTIVE" or .state == "in_progress" or .state == "queued")')" |
There was a problem hiding this comment.
The --jq state filter is case-sensitive and currently handles open/active in both cases but not queued/in_progress, which makes it easy to miss active sessions if the API returns those states with different casing. Consider normalizing .state once (e.g., downcasing) and comparing against a single canonical set of active states to avoid this inconsistency.
Suggested change
| active_sessions="$(gh agent-task list --limit 100 --json id,name,state,repository,updatedAt,pullRequestNumber,pullRequestUrl --jq '.[] | select(.state == "open" or .state == "OPEN" or .state == "active" or .state == "ACTIVE" or .state == "in_progress" or .state == "queued")')" | |
| active_sessions="$(gh agent-task list --limit 100 --json id,name,state,repository,updatedAt,pullRequestNumber,pullRequestUrl --jq '.[] | (.state | ascii_downcase) as $state | select($state == "open" or $state == "active" or $state == "in_progress" or $state == "queued")')" |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gh agent-taskcommand usageworkflow_dispatchgh agent-taskextension and print active agentic task sessions