Skip to content

Support full GitHub issue URLs in --issue flag #40

@chanakyav

Description

@chanakyav

Support passing a full GitHub issue URL to --issue, not just a number. This enables starting tasks from issues in a different repo than the one you're working in.

Use Case

You're in /workspaces/github and want to implement a task described in an issue on org/design-docs:

autopilot start --issue https://github.com/org/design-docs/issues/45

Today this fails because --issue is type=int in argparse.

Current Behavior

autopilot start --issue 123        # works (current repo only)
autopilot start --issue https://... # argparse error: invalid int value

Proposed Behavior

autopilot start --issue 123                                    # same repo (backward compatible)
autopilot start --issue https://github.com/org/repo/issues/45  # cross-repo URL

Both fetch the issue title+body for the prompt. All git operations (branch, commit, PR) still happen in the CWD repo — the issue is just context.

Implementation

  1. Change --issue from type=int to type=str in argparse
  2. In cmd_start, parse the value:
    • If it matches https://github.com/{owner}/{repo}/issues/{number}, extract repo and number
    • If it's a plain number, use current repo (backward compatible)
  3. Add repo param to get_issue(): gh issue view 123 --repo owner/repo
  4. Tests for: plain number, full URL, URL from different repo, invalid URL

~15 lines of code changes + tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions