Skip to content

feat(skill): offer Action or GitHub App mode, and check the permission first - #31

Merged
akf66 merged 1 commit into
mainfrom
akf66/app-install-mode
Aug 26, 2026
Merged

feat(skill): offer Action or GitHub App mode, and check the permission first#31
akf66 merged 1 commit into
mainfrom
akf66/app-install-mode

Conversation

@akf66

@akf66 akf66 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

The App exists at github.com/apps/orcacode-review, but the skill only knew about the Action. Now it asks which, and routes.

The ordering is the point

It probes what the user can actually do before offering the choice:

gh api /repos/<o>/<n> --jq .permissions.admin
gh api /orgs/<o>/memberships/<user> --jq .role

Installing a GitHub App is a permission grant — GitHub requires a human to approve it on an authorization page, and there is no REST endpoint that does it on someone's behalf. Deliberate, not a gap.

So offering App mode to a plain org member walks them to a page that stops them. Verified against this repo:

{"admin": false, "owner": "Continuum-AI-Corp", "ownerType": "Organization"}
role: member

The account we've been running all day could not complete App mode. The skill now says that up front instead of finding out three steps in.

App mode hands over a link

https://github.com/apps/orcacode-review/installations/new

It prints the URL and only optionally opens it. A tool that silently calls open in an SSH session, a container, or CI leaves the user waiting on a browser that never appears.

It also says to pick this repository rather than "all repositories" — a much larger grant, and on a paid plan a much larger bill.

Verification is honest about its limits

Route Why not
GET /repos/{o}/{r}/installation Needs the App's own JWT. No user token can produce one — confirmed, 401.
GET /orgs/{o}/installations Needs admin:org. Not worth asking for write-level org scope to read one flag.

Fallback: open a PR and look for the bot review — the thing the user actually cares about.

The failure mode this choice creates

Both installed → two reviews per PR, double spend. Documented in the skill and in troubleshooting.md, with the note that removing the Action is the reversible half — revoking an App installation is a permission change only an admin can make.

Also

Renames Action step 5 from "Enable the app". It means the OrcaRouter console, which now reads as the GitHub App and would send people to the wrong place.

Tests

Four new, pinning what would rot quietly: both modes present and linked, the permission warning ordered before the routing line, no claim the install is automatable, the print-don't-just-open rule, and the conflict documented in both files.

393 passing on top of #28. 1.3.0 — merging publishes it.

…n first

The App exists at github.com/apps/orcacode-review but the skill only knew
about the Action. Now it asks which, and routes.

The ordering is the point. It probes the user's actual rights BEFORE
offering the choice:

    gh api /repos/<o>/<n> --jq .permissions.admin
    gh api /orgs/<o>/memberships/<user> --jq .role

Installing a GitHub App is a permission grant, so GitHub requires a human to
approve it on an authorization page — there is no REST endpoint that does it
on someone's behalf, by design. Offering App mode to a plain org member
walks them to a page that stops them. Verified against this very repo: the
account running it is `member`, `admin: false`, and could not complete it.

App mode therefore hands over a link rather than pretending to automate:

    https://github.com/apps/orcacode-review/installations/new

It prints the URL and only optionally opens it. A tool that silently calls
`open` in an SSH session, a container or CI leaves the user waiting on a
browser that will never appear.

Verification is honest about its limits. /repos/{o}/{r}/installation needs
the App's own JWT, which no user token can produce; /orgs/{o}/installations
needs admin:org, which is not worth asking for just to read a flag. So the
fallback is to open a PR and look for the bot — the thing the user cares
about anyway.

Also documents the failure mode this choice creates: both installed means
two reviews per PR and double spend. Recorded in the skill and in
troubleshooting, with the note that removing the Action is the reversible
half.

Renames Action step 5 from "Enable the app" — it means the OrcaRouter
console, which now reads as the GitHub App and would send people to the
wrong place.
@akf66
akf66 merged commit e7bb3d1 into main Aug 26, 2026
2 checks passed
@akf66
akf66 deleted the akf66/app-install-mode branch August 26, 2026 06:53
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.

1 participant