App installation clone token is narrowed to the parent repo, so private submodules 404
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
- Fetch
.gitmoduleswith the parent-scoped token (contents API,Accept: application/vnd.github.raw). - Parse same-owner submodule URLs (relative
../repo.git,https://github.com/owner/repo.git,[email protected]:owner/repo.git). - Remint
POST /app/installations/:id/access_tokenswithrepositories: [parent, ...submoduleRepos]. - Keep least privilege (do not drop the
repositorieslist).
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.
Source: oblien/openship