Cross-host handoff caches failed Git origin lookup and reports no matching project with Git 2.43

Open 💬 0 comments Opened Aug 8, 2026 by imyller

What issue are you seeing?

Codex’s remote git-origins worker fails to read remote.origin.url on Ubuntu 24.04 with distribution default Git 2.43, but the failed result is still returned or cached as an origin record without a usable URL.

Codex runs:

git -c safe.bareRepository=explicit \
    -c core.hooksPath=/dev/null \
    -c core.fsmonitor= \
    config --get remote.origin.url

with the working directory set to the repository’s .git directory:

cwd=/home/<user>/repo/.git

With Git 2.43, this exits 1 without stdout or stderr:

requestKind=git-origins
cwd=/home/<user>/repo/.git
exitCode=1
stdoutBytes=0
stderrBytes=0
success=false

Despite the failure, the git-origins worker reports completion with one origin record. The unavailable/null origin is then used by cross-host repository matching as though discovery succeeded.

The user-facing result is:

No matching saved project was found on Local.

This is misleading: the local and remote projects are separate checkouts of the same repository, with identical normalized origins and matching repository-relative paths.

The central bug is that a failed origin lookup must not be cached or passed to repository matching as originUrl: null. It should be retried or surfaced as an origin-discovery error.

What steps can reproduce the bug?

  1. Connect an Ubuntu 24.04 remote host running Git 2.43 to the ChatGPT desktop app using a Codex-managed SSH connection.
  2. Create separate local macOS and remote Ubuntu checkouts of the same Git repository.
  3. Configure both checkouts with the same remote.origin.url.
  4. Save both folders as Codex projects.
  5. Open a task in the remote project.
  6. Attempt to hand off the task to the matching local project.
  7. Observe:

> No matching saved project was found on Local.

  1. Check the desktop logs and observe that the git-origins command above was run with cwd set to the remote repository’s .git directory and exited 1.

A normal query from the worktree root succeeds:

cd /home/<user>/repo
git config --get remote.origin.url

Confirmed control test:

  1. Upgrade only the remote Git installation from 2.43 to 2.54.
  2. Do not change the repository, origin, branch, worktrees, saved projects, or source task.
  3. Restart the ChatGPT desktop app.
  4. Attempt the same handoff again.

With Git 2.43, the internal command exits 1 without output. With Git 2.54, it succeeds, and the same handoff completes with full task history preserved.

What is the expected behavior?

Codex should successfully discover remote.origin.url on the Git version supplied by Ubuntu 24.04, preferably by querying from the worktree root or using an explicit --git-dir.

If the Git command exits nonzero:

  • Do not cache or return an origin record with originUrl: null.
  • Do not pass that record to repository matching.
  • Retry using a compatible Git invocation, or report the origin-discovery failure directly.
  • Distinguish origin-discovery failure from a genuine repository mismatch.

For example:

Could not determine the Git origin of the source project.

Codex should not report “No matching saved project” when it was unable to determine the source project’s origin.

Additional information

Environment:

  • ChatGPT/Codex desktop build: 26.803.41515
  • Remote Codex app-server: 0.147.0
  • Local OS: macOS
  • Remote OS: Ubuntu 24.04.4 LTS
  • Failing remote Git version: 2.43.0
  • Working remote Git version: 2.54.0
  • Connection: Codex-managed SSH remote

After upgrading Git and restarting the app:

  • Codex discovered the existing remote origin.
  • The existing saved local project became a valid destination.
  • The handoff succeeded.
  • Codex created the destination worktree.
  • The transferred task opened locally with its complete history.

No repository or task changes were needed. This isolates the failure to the origin-query behavior with Git 2.43.

The following were checked and ruled out:

  • SSH connectivity or remote Codex authentication
  • Different origin URLs
  • Repository-relative path mismatch
  • Invalid saved-project roots
  • Branch ownership conflicts
  • Active or detached Codex worktrees

Restarting the app, repairing project roots, and recreating the local saved project did not help while the remote host used Git 2.43.

Suggested fixes:

  1. Run the origin query from the worktree root.
  2. Alternatively, use an explicit Git directory:

``sh
git --git-dir=/path/to/repository/.git \
config --get remote.origin.url
``

  1. Treat any nonzero origin-query result as an error.
  2. Never cache or reuse a failed result as originUrl: null.
  3. Prevent records without a usable origin URL from entering repository matching.
  4. Replace the misleading project-matching message with an actionable origin-discovery error.

Ubuntu 24.04 normally supplies Git 2.43, so this may affect other Codex SSH remote users.

View original on GitHub ↗