cloud-tasks: support Forgejo/Gitea remotes in by-repo environment detection
Resolved 💬 1 comment Opened Mar 9, 2026 by tfiala Closed May 10, 2026
Codex CLI currently misses PR/footer context for Forgejo/Gitea repos because by-repo environment detection is GitHub-only.
Observed behavior
- In repos with origin like
https://git.home.invezt.io/<owner>/<repo>(Forgejo), Codex does not resolve repo context and PR/footer indicators are absent. - Same workflow in
github.comrepos works.
Root cause
codex-rs/cloud-tasks/src/env_detect.rshardcodes GitHub parsing and provider routing:- only parses
github.comremote formats - hardcodes
.../by-repo/github/<owner>/<repo>
Proposed fix
- Parse generic repo refs from HTTPS + SSH forms into host/owner/repo.
- For non-GitHub hosts, try provider fallbacks in this order:
1) forgejo
2) gitea
3) github
- Preserve current GitHub behavior: host
github.comuses only providergithub.
Patch available
- Branch:
tfiala:fix/forgejo-by-repo-provider - Compare: https://github.com/openai/codex/compare/main...tfiala:fix/forgejo-by-repo-provider
What this patch changes
- Adds
RepoRef { host, owner, repo }parser. - Replaces GitHub-only
parse_owner_repologic with genericparse_repo_ref. - Adds
provider_candidates_for_hostand uses it in both: autodetect_environment_idlist_environments- Adds unit tests for:
- GitHub HTTPS + SSH SCP parsing
- Forgejo HTTPS + SSH URL parsing
- invalid remote rejection
- provider-candidate selection
Validation run
cargo test -p codex-cloud-tasks env_detect -- --nocapture- Result: 7 env_detect tests passed.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗