Skip to content

Add classic workflow to list active agentic task sessions#27615

Merged
pelikhan merged 4 commits intomainfrom
copilot/create-action-workflow-to-list-sessions
Apr 21, 2026
Merged

Add classic workflow to list active agentic task sessions#27615
pelikhan merged 4 commits intomainfrom
copilot/create-action-workflow-to-list-sessions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

  • Review repository workflow patterns and gh agent-task command usage
  • Run baseline validation to identify pre-existing issues
  • Add a classic GitHub Actions workflow triggered by workflow_dispatch
  • Configure the workflow to install gh agent-task extension and print active agentic task sessions
  • Address workflow review feedback for token handling and state filtering
  • Run validation commands relevant to the change
  • Commit and push changes with updated checklist
  • Open a pull request

Copilot AI and others added 2 commits April 21, 2026 16:16
Removed the step that shows the authentication token source.
Copilot AI requested a review from pelikhan April 21, 2026 16:26
@pelikhan pelikhan marked this pull request as ready for review April 21, 2026 16:26
Copilot AI review requested due to automatic review settings April 21, 2026 16:26
@pelikhan pelikhan merged commit 684f193 into main Apr 21, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/create-action-workflow-to-list-sessions branch April 21, 2026 16:26
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Smoke CI completed successfully!

@github-actions
Copy link
Copy Markdown
Contributor

✅ smoke-ci: safeoutputs CLI comment only run (24733941464)

Generated by Smoke CI for issue #27615 ·

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dispatch workflow for listing agentic task sessions.
  • Installs/updates the github/agent-task GitHub CLI extension at runtime.
  • Queries sessions via gh agent-task list and 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")')"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")')"

Copilot uses AI. Check for mistakes.
@github-actions github-actions Bot mentioned this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants