2026-06-14Repository implementationIssue gh-forgejo-shim-xva

Restored GitHub PR delegation and Forgejo PR link output

The shim now refuses to treat known GitHub hosts as Forgejo, even when stale config says otherwise, and it renders simple GitHub CLI template probes used for clickable PR URLs.

Summary

Fixed a regression where Codex.app could see Forgejo PR data but GitHub repositories reported PR info unavailable. The local config contained github.com in the Forgejo allowlist; the shim now ignores that host and delegates GitHub repositories to the real gh. I also added simple --template rendering so Forgejo PR URL probes can return a bare URL for click-through behavior.

Changes Made

GitHub Delegation

Added known-GitHub host filtering in config loading, host addition, and route checks so github.com cannot become an emulated Forgejo host.

Bootstrap Guard

Updated bootstrap so running it from a GitHub checkout does not add github.com or request Forgejo auth for that repo.

PR Link Compatibility

Implemented simple Go-template field substitution for JSON output, including nested selectors such as {{.currentBranch.url}} and the jq value form {{.}}.

Delegation Safety

Prevented a configured real-gh path from pointing back at a managed shim and recursing during delegated GitHub commands.

Context

The observed machine config had hosts = ["git.deltaisland.io", "git.dirtydishes.dev", "github.com"]. Before this change, that made GitHub PR commands route through the Forgejo compatibility layer and return empty PR data. IslandFlow still produced URL fields in JSON, but newer Codex.app link probes may ask the GitHub CLI to format a single URL with --template; the shim parsed that flag but previously ignored it.

Important Implementation Details

Relevant Diff Snippets

Focused excerpt rendered with Diffs server-side rendering via @pierre/diffs/ssr and embedded as static iframe content. It covers the host guard and template output path; regression tests and docs are summarized in prose to keep this file reviewable.

Expected Impact for End-Users

Codex.app should stop treating GitHub repositories as Forgejo, so GitHub PR info can come from the real GitHub CLI again. Forgejo repositories such as IslandFlow should keep returning PR data and can now answer URL-only template probes with a direct link like https://git.dirtydishes.dev/dirtydishes/islandflow/pulls/23.

Validation

Issues, Limitations, and Mitigations

Follow-up Work