Skip to content

feat(web): authorize a whole installation from Authorize repository - #2509

Merged
zfy0701 merged 1 commit into
mainfrom
claude/unified-authorize
Sep 25, 2026
Merged

zfy0701 merged 1 commit into
mainfrom
claude/unified-authorize

Conversation

@zfy0701

@zfy0701 zfy0701 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of #2398. This makes adding repository access a single flow, and makes the Workspace card's count honest:

  • Edit workspace had two add entries, Authorize repository and Authorize an installation, while the Workspace card's dropdown offered only the first. Installations can now be authorized from Authorize repository.
  • The card's +N repos trigger counted an installation grant, which covers a whole account, as one repository.

Changes

  • AddAgentRepoModal.tsx
    • When Edit workspace passes onInstallationCreated, the GitHub picker lists, first, "All repositories in <account>" for each installation the agent can still be granted: live, unsuspended and not already held (grantableInstallations, moved here). Search matches the account name.

    • Organization owners can pick it. Everyone else sees it disabled, with the existing owner-only tooltip.

    • Picking an installation:

      • keeps the Read only / Read & write tiers, and the write tier names every repository as its reach;
      • limits the checkout to By decision / On demand, defaulting to On demand;
      • submits through createAgentInstallation.

      Picking a repository afterwards puts the checkout back to Always.

  • EditWorkspaceModal.tsx: passes the grants, the owner check and the created-grant handler. The separate Authorize an installation button and its subview are removed, and AuthorizeInstallationModal.tsx is deleted.
  • WorkspaceCard.tsx: the trigger reads +3 repos, +1 org, +3 repos · 1 org, or Repos when there is nothing, in en and zh-CN.
  • i18n: the strings only the deleted subview used are removed from both locales.
  • Docs:
    • product-conventions.md: one add flow whose GitHub picker also offers whole installations.
    • agent-multi-repo-authorization.md: the status note, the Web section, and walkthrough F.

A manual GitHub workspace's picker stays locked to its own repository, so it offers no installation.

Tests

  • pnpm --dir packages/web exec vitest run --maxWorkers=2 src/components/console/modals/ src/components/console/WorkspaceCard.test.tsx: 24 files, 204 tests passed. The installation cases now go through Authorize repository:
    • which installations are offered;
    • the tiers, the reach wording and the checkout options;
    • the POST body, and the grant handed back to the dialog;
    • a server refusal, which keeps the step open;
    • the owner-only choice for a non-owner;
    • By decision from the picker.
  • pnpm --dir packages/web exec vitest run --maxWorkers=2 (the whole web unit suite): 308 files, 3305 tests passed.
  • pnpm --filter @agentconnect.md/web typecheck and node scripts/check-i18n.mjs pass, and prettier and eslint are clean on the changed files.

Not checked in a browser: the web mock preview has no GitHub installations. I'll check it on the test environment after deploy.

🤖 Generated with Claude Code . Opus 5.5

Edit workspace had two add entries, Authorize repository and Authorize an
installation, while the Workspace card's dropdown offered only the first.
Authorize repository's GitHub picker now lists, first, "All repositories
in <account>" for each installation the agent can still be granted (owner
only; others see it disabled with the owner-only tooltip). Picking one
keeps the Read only / Read & write choice with the installation's reach,
offers By decision / On demand (default On demand), and creates the grant.
The separate entry and AuthorizeInstallationModal are gone.

The Workspace card's trigger now counts repositories and whole accounts
apart ("+3 repos · 1 org"), since a grant is an account, not a repository.

Part of #2398.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zfy0701
zfy0701 enabled auto-merge (squash) September 25, 2026 12:59

@agentconnect-md-test agentconnect-md-test Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved. The consolidated GitHub picker offers grantable installations with the owner gate, submits grants through the existing API, and the Workspace card counts repositories and installations separately.

Non-blocking edge case: after selecting an installation, switching to GitLab or Gitea, choosing “Always,” and returning to GitHub leaves the installation selected with an invalid checkout value. Add then sends materialize: always, which the installation endpoint rejects. Normalize checkout when returning to the selected installation.

I reviewed the verified PR revision and its existing tests. I could not run tests locally because this checkout has no installed dependencies and pnpm is unavailable.

sent by review-bot (Codex · gpt-6-sol) · open in session

@zfy0701
zfy0701 merged commit aa4d949 into main Sep 25, 2026
13 checks passed
@zfy0701
zfy0701 deleted the claude/unified-authorize branch September 25, 2026 13:06
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