Describe the bug
gh lets you override a host's API endpoint with api_host in hosts.yml:
example.ghe.com:
api_host: api-proxy.example.com
gh itself honors it, but gh stack does not. It pins github.com/cli/go-gh/v2 at v2.13.0, and per-host api_host support was added to go-gh in v2.15.0. As a result, gh stack sends its REST and GraphQL requests to the host's default API endpoint.
When that endpoint isn't reachable, for example because the network only allows the configured API host, gh stack submit fails with a misleading message: Stacked PRs are not enabled for this repository.
Fix: bump github.com/cli/go-gh/v2 from v2.13.0 to v2.16.1, the latest release. No code changes are needed: go-gh resolves api_host when the clients in internal/github are created. The other go.mod/go.sum changes are transitive updates. A one-commit fix is on kaimallea/gh-stack branch bump-go-gh-api-host. I tried to open a PR, but outside contributors can't create PRs on this repo. Happy to open one if you can enable that.
Affected command
gh stack submit (also gh stack view, and any command that calls the API)
gh-stack version
gh stack version 0.2.0
GitHub CLI version
gh version 2.102.0 (2026-09-30)
Operating system
macOS 27.0.1
Shell
zsh
Steps to reproduce
- Configure a host with an
api_host override in ~/.config/gh/hosts.yml (see above), on a network where only the configured API host is reachable.
- In a repository on that host, run
GH_DEBUG=api gh stack submit --auto (or GH_DEBUG=api gh stack view).
- Observe the request URL in the debug output.
Expected behavior
gh stack sends API requests to the configured api_host, as gh does.
Actual behavior
gh stack sends API requests to the host's default API endpoint. The request fails, and submit reports that stacked PRs aren't enabled for the repository.
With go-gh bumped to v2.16.1, the same GH_DEBUG=api gh stack view sends requests to the configured api_host and succeeds. go build ./... and go vet ./... pass. Hosts without api_host are unaffected: go-gh only changes the endpoint when the setting is present.
Terminal output
$ GH_DEBUG=api gh stack submit --auto
Checking stack state...
* Request to https://api.example.ghe.com/repos/OWNER/REPO/stacks?per_page=100&page=1
> GET /repos/OWNER/REPO/stacks?per_page=100&page=1 HTTP/1.1
> Host: api.example.ghe.com
* remote error: tls: access denied
⚠ Stacked PRs are not enabled for this repository
Preflight checks
Describe the bug
ghlets you override a host's API endpoint withapi_hostinhosts.yml:ghitself honors it, butgh stackdoes not. It pinsgithub.com/cli/go-gh/v2at v2.13.0, and per-hostapi_hostsupport was added to go-gh in v2.15.0. As a result,gh stacksends its REST and GraphQL requests to the host's default API endpoint.When that endpoint isn't reachable, for example because the network only allows the configured API host,
gh stack submitfails with a misleading message:Stacked PRs are not enabled for this repository.Fix: bump
github.com/cli/go-gh/v2from v2.13.0 to v2.16.1, the latest release. No code changes are needed: go-gh resolvesapi_hostwhen the clients ininternal/githubare created. The othergo.mod/go.sumchanges are transitive updates. A one-commit fix is onkaimallea/gh-stackbranchbump-go-gh-api-host. I tried to open a PR, but outside contributors can't create PRs on this repo. Happy to open one if you can enable that.Affected command
gh stack submit (also gh stack view, and any command that calls the API)
gh-stack version
gh stack version 0.2.0
GitHub CLI version
gh version 2.102.0 (2026-09-30)
Operating system
macOS 27.0.1
Shell
zsh
Steps to reproduce
api_hostoverride in~/.config/gh/hosts.yml(see above), on a network where only the configured API host is reachable.GH_DEBUG=api gh stack submit --auto(orGH_DEBUG=api gh stack view).Expected behavior
gh stacksends API requests to the configuredapi_host, asghdoes.Actual behavior
gh stacksends API requests to the host's default API endpoint. The request fails, andsubmitreports that stacked PRs aren't enabled for the repository.With go-gh bumped to v2.16.1, the same
GH_DEBUG=api gh stack viewsends requests to the configuredapi_hostand succeeds.go build ./...andgo vet ./...pass. Hosts withoutapi_hostare unaffected: go-gh only changes the endpoint when the setting is present.Terminal output
Preflight checks
gh extension upgrade stackand reproduced this issue on the latest stable release.