Skip to content

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

Open

Description

@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.

  8. 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:

    git --git-dir=/path/to/repository/.git \
        config --get remote.origin.url
  3. Treat any nonzero origin-query result as an error.

  4. Never cache or reuse a failed result as originUrl: null.

  5. Prevent records without a usable origin URL from entering repository matching.

  6. 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.

Activity

  1. rasmusahlin commented on Sep 25, 2026

    @rasmusahlin

    I can reproduce the same user-facing error in the opposite direction: local macOS task → saved Ubuntu WSL2 project over Codex SSH.

    Environment: Codex Desktop on macOS (desktop log buildNumber=10954), remote Ubuntu 24.04.5 LTS in WSL2, remote codex-cli 0.157.0, Git 2.43.0. The remote SSH project works for new Codex tasks, including after a Windows reboot.

    Two separate synthetic checkouts of the same private test repository are saved as Codex projects on the Mac and remote host. Both have the identical HTTPS remote.origin.url and HEAD SHA, and both project roots are the repository root. I also added a second clean remote checkout with the same directory basename as the Mac checkout and saved it as another remote project. Handoff still fails immediately with:

    No matching saved project was found on <SSH host>.
    

    The desktop log records that error for handoff_thread (2026-09-25 21:14:51 UTC). No remote worktree or file was created. Handoff from a Mac worktree to the Mac checkout of this repo succeeded, so the task and local Git state are transferable.

    The exact Git command from this issue, run with cwd in the remote checkout's .git directory, reproduces the origin lookup failure on this host:

    $ git --version
    git version 2.43.0
    $ cd <remote-repo>/.git
    $ git -c safe.bareRepository=explicit -c core.hooksPath=/dev/null -c core.fsmonitor= config --get remote.origin.url
    $ echo $?
    1
    

    A normal origin query from the worktree root succeeds. I have not verified from an internal trace that this failed remote origin query is the specific lookup used in my local-to-remote Handoff attempt, but the environment, command behavior, and error match this issue. This suggests the Git 2.43 compatibility problem may affect both Handoff directions.

  2. justgiganni commented on Sep 29, 2026

    @justgiganni

    I can reproduce the cross-host “No matching saved project” error on MacBook Pro macOS 26.6.2 → Mac Mini over Codex remote connection with separate saved Git projects at each repository root. Both checkouts have the same HTTPS origin and HEAD. The original chat is idle and its composer is empty. Native handoff returns the error before an operation ID or destination worktree.

    On the MacBook, Command Line Tools 16.4 / Apple Git 2.39.5 made the exact guarded origin lookup in the repository's .git directory exit 1 with no output, matching this issue. I installed Apple's Command Line Tools 26.6; default Apple Git became 2.50.1, and the exact same lookup now exits 0 with the correct origin. I fully quit/reopened the Codex desktop app and retried a single native handoff after clearing the original chat's composer. It still returns “No matching saved project.”

    The restarted desktop log immediately before this attempt reports 1 local directory / 1 origin record, then 5 destination directories / 5 origin records, then the matching error. It does not log compared origin URLs, normalized paths, or a repository-specific Git command failure. This suggests the older Git lookup was a real problem here, but updating Git alone did not resolve the remaining project match. Could the handoff diagnostic report which saved-project origin/path failed to match, or invalidate any persisted failed-origin record? No repository, branch, or project was recreated during the test.

    I can provide sanitized timestamps and logs through a private support channel if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingremote

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions