#979·openship

App installation clone token is narrowed to the parent repo, so private submodules 404

Author: greersoCreated Sep 28, 2026Updated Sep 28, 2026

Self-hosted 0.8.0: after a workspace GitHub App is connected, server clones mint an installation token with repositories: [parentRepo] (packages/platform/src/engine/modules/github/github.token.ts → tryInstallationToken).

packages/adapters/src/runtime/git-clone.ts injects that token into the parent HTTPS URL. Relative submodule URLs (../other-private.git) inherit it. GitHub then 404s Repository not found for the submodule because the token is not allowed on that repo.

The per-submodule credential helper (gitCredentialHelperPath) only exists on the desktop relay path.

Before an App exists, the chain falls through to a clone token / gh CLI with owner-wide access, so this only shows up after connecting a GitHub App.

Proposed fix

  1. Fetch .gitmodules with the parent-scoped token (contents API, Accept: application/vnd.github.raw).
  2. Parse same-owner submodule URLs (relative ../repo.git, https://github.com/owner/repo.git, [email protected]:owner/repo.git).
  3. Remint POST /app/installations/:id/access_tokens with repositories: [parent, ...submoduleRepos].
  4. Keep least privilege (do not drop the repositories list).

Also: redactCredentials / URL_USERINFO caps userinfo at 512 characters. App installation tokens in x-access-token:<jwt> routinely exceed that, so deployment.errorMessage stores the full tokenized clone URL. Raise the bound (2048) so truncateError → sanitizeStorableStrings actually redacts it.

Happy to send a PR. Observed on v0.8.0 (234d8a9) with a self-hosted custom GitHub App.