Skip to content

Feature request: --json support and finer-grained status for gh agent-task #12805

@maxbeizer

Description

@maxbeizer

Problem

I maintain gh-agent-viz, a TUI extension for monitoring Copilot coding agent sessions. I consume gh agent-task list and gh agent-task view output to build an interactive dashboard. Two gaps make this harder than it should be:

1. No --json flag 📦

gh agent-task list and gh agent-task view don't support --json, unlike most other gh commands. This means downstream tools have to scrape human-readable output, which is fragile and breaks when formatting changes.

What I'd love: --json support on list and view, consistent with the pattern used by gh pr list --json, gh issue list --json, etc.

2. running status covers two very different states 🤔

Currently a session has these statuses: running, needs-input, completed, failed, queued.

The problem is running conflates:

  • Agent is actively working — writing code, running tests, making commits. Nothing for the user to do.
  • Agent has responded and is waiting for the user — the agent finished its turn and the conversation is idle until the user continues.

Only needs-input (the agent explicitly asked a blocking question) surfaces as distinct. But the much more common case — agent finished a task and is waiting for the next instruction — looks identical to "agent is actively coding."

Why it matters: In a monitoring dashboard, users need to know which sessions need their attention. "Agent is waiting on me" is actionable; "agent is busy working" is not. Without this distinction, users have to click into each running session to figure out if it needs them.

What I'd love: A way to distinguish these states. Some options:

  • A new status value like awaiting-user or idle
  • A field in the output indicating who spoke last (agent vs user)
  • A last_activity or last_agent_response timestamp that tools can use to infer idle state

Proposed --json fields 🗂️

For gh agent-task list --json, fields like:

Field Type Description
id string Session ID
status string Current status
repository string owner/repo
branch string Working branch
title string Session title or first message
createdAt timestamp When the session started
updatedAt timestamp Last activity
pullRequestNumber int Associated PR number, if any
pullRequestUrl string Associated PR URL, if any

For gh agent-task view <id> --json, additionally:

Field Type Description
events array Session event log
lastSpeaker string user or agent — who sent the last message

Willingness to contribute 🙋

Happy to help with a PR for the --json support if the team is open to contributions here! I'm already parsing the output in Go so I have a good sense of the data shape.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-agent-taskRelated to gh agent-task command sethelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions