WL-0MKYOAM4Q10TGWND: Implement wl github delegate command#783
Merged
rgardler-msft merged 5 commits intomainfrom Mar 2, 2026
Merged
WL-0MKYOAM4Q10TGWND: Implement wl github delegate command#783rgardler-msft merged 5 commits intomainfrom
rgardler-msft merged 5 commits intomainfrom
Conversation
… helpers
Add new exported functions to src/github.ts that wrap
`gh issue edit --add-assignee` with the existing retry/backoff
infrastructure:
- assignGithubIssueAsync: async variant with rate-limit retry/backoff
(configurable retries, default 3). Returns { ok, error? } without
throwing on failure.
- assignGithubIssue: sync variant using runGhDetailed. Returns
{ ok, error? } without throwing on failure.
- AssignGithubIssueResult interface exported for consumers.
Includes 11 unit tests covering success, failure, retry on rate-limit/403,
max retry exhaustion, and command construction verification.
…ent delegate subcommand with guard rails, push/assign flow, and output formatting - Register `wl github delegate <id>` subcommand with --force, --json, --prefix options - Implement do-not-delegate tag guard rail with --force bypass - Implement children warning with TTY prompt; non-interactive mode proceeds silently - Wire push (upsertIssuesFromWorkItems) + assign (assignGithubIssueAsync) + local state update - On assignment failure: skip local state update, add comment, re-push for consistency - Support both human-readable progress output and structured --json output - Add 13 unit tests covering guard rails, success/failure paths, and output formatting
The delegate command was passing 'copilot' to gh issue edit --add-assignee, but GitHub requires '@copilot' for Copilot assignment. Updated the assignee argument, error messages, console output, and all related tests.
…ul delegation On successful delegation, the local state update now includes stage='in_progress' alongside status='in-progress' and assignee='@github-copilot'. A re-push is performed after the local update so the GitHub issue immediately reflects the updated wl:status:in-progress and wl:stage:in_progress labels.
…dated." to failure output and first-push test - Fix AC #2: failure message now includes "Local state was not updated." to clearly indicate local state was preserved on assignment failure - Add test verifying failure output contains the phrase - Add test for first-push path (no githubIssueNumber) that creates the GitHub issue before assigning to @copilot - All 1174 tests pass across 92 test files
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.
Summary
Implements the complete
wl github delegate <id>CLI subcommand that pushes a Worklog work item to GitHub and assigns it to the Copilot coding agent in one command.delegateas a subcommand ofwl githubwith--force,--json, and--prefixoptionsdo-not-delegatetag check (with--forcebypass) and children warning (TTY prompt in interactive mode, silent proceed in non-interactive)upsertIssuesFromWorkItems) + assign (viaassignGithubIssueAsync) + local state update (status=in-progress,assignee=@github-copilot)--jsonoutput with partial failure detailscopilotto@copilotto match GitHub's required format for Copilot assignment (WL-0MM8NN4S71WUBRFT)Work Items
Note: This PR depends on PR #782 (assignGithubIssue helper) being merged first.
Files Changed
src/commands/github.ts— Addeddelegatesubcommand; fixed@copilotassignee handletests/cli/delegate-guard-rails.test.ts— 13 unit tests, updated for@copilotsrc/github.ts— AddedassignGithubIssueAsyncandassignGithubIssuehelpers (from PR WL-0MM8LWWCD014HTGU: Add assignGithubIssue helper for delegate command #782)tests/github-assign-issue.test.ts— 11 assign helper tests, updated for@copilotTesting
All 1172 tests pass. TypeScript compiles cleanly.