Skip to content

Conversation

@BagToad
Copy link
Member

@BagToad BagToad commented Aug 27, 2025

Introduce gh agent-task with the following aliases:

  • gh agent-tasks
  • gh agent
  • gh agents

This establishes the root command for future gh agent-task sub-commands.

This also implements a persistent OAuth token requirement that will run for all future sub-commands.

Important

NOT merging into trunk

@BagToad BagToad force-pushed the kw/997-gh-agent-task-responds-and-exits-if-user-not-authenticated-with-oauth branch 2 times, most recently from bd9bb80 to 13c40c9 Compare August 27, 2025 18:15
@BagToad BagToad requested a review from babakks August 27, 2025 18:17
@BagToad BagToad marked this pull request as ready for review August 27, 2025 18:18
@BagToad BagToad requested a review from a team as a code owner August 27, 2025 18:18
Introduces a new `agent-task` command under pkg/cmd/agent with strict OAuth (device flow) token validation. Includes comprehensive tests for token source and host validation, and registers the command in the root command set.
@BagToad BagToad force-pushed the kw/997-gh-agent-task-responds-and-exits-if-user-not-authenticated-with-oauth branch from 13c40c9 to 3573f61 Compare August 27, 2025 18:23
Copy link
Member

@babakks babakks left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! 🙏 I think we should simplify the tests, but I'm also okay with a follow up. So, approving.

Changed the RunE function of the agent-task command to display help output instead of returning nil, improving user guidance when the command is run without arguments.
Replaces require.Equal with require.Empty in TestOAuthTokenAccepted for improved clarity when checking for empty output.
Consolidates multiple individual test functions into a single table-driven test, improving maintainability and readability. This change makes it easier to add new test cases and ensures consistent test structure for agent task command authentication scenarios.
@BagToad BagToad merged commit 09be17e into github-cli-epic-990 Aug 27, 2025
7 of 8 checks passed
@BagToad BagToad deleted the kw/997-gh-agent-task-responds-and-exits-if-user-not-authenticated-with-oauth branch August 27, 2025 23:27
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