[Bug]: Changes/Diff view shows 0 changes when the repository has no git remote configured #7662
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
- Open a thread on a repository that has no git remote (
git remoteprints nothing) — e.g. a local-only brainstorming repo, thread running in a linked worktree. - Let the agent edit files so the working tree has uncommitted changes (
git statuslists them). - Open the changes/diff view.
Expected behavior#
The view lists the changed files and renders diffs. The data exists: per-turn checkpoint refs (refs/t3/checkpoints/<thread>/turn/N) are created, projection_turns.checkpoint_files_json records the correct per-file additions/deletions, and the latest checkpoint tree matches the working tree.
Actual behavior#
The view shows "0 changes" and no diffs can be opened. checkpoint_diff_blobs stays empty. The server trace shows every refresh failing while resolving the diff base: resolvePrimaryRemoteName throws GitCommandError: No git remote is configured for this repository (inside resolveRemoteRepositoryContext → resolveDefaultBranchName → resolveCurrentUpstream), which kills the whole diff computation even though checkpoints and the local branch are sufficient to render it. A fallback to the local default branch / checkpoint refs when no remote exists would fix it.
Impact#
Major degradation or frequent failure
Version or commit#
0.0.34-nightly.20260815.1102 (desktop AppImage)
Environment#
NixOS (Linux 6.18), local backend, git linked worktree, agent edits made via shell tools
Logs or stack traces#
{"type":"effect-span","name":"resolvePrimaryRemoteName", ... "exit":{"_tag":"Failure","cause":"GitCommandError: Git command failed in GitVcsDriver.resolvePrimaryRemoteName (~/.t3/worktrees/<project>/<thread>): No git remote is configured for this repository.\n at .../resources/app.asar/apps/server/dist/bin.mjs:73997:17"}}
Workaround#
git remote add origin <url> on the repo — any configured remote (it does not need to exist upstream) makes diff-base resolution succeed and the view populate. Possibly related symptom-wise: #5616.
olstenlarck(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Correction after further testing: adding a git remote is not a fix. Per-turn checkpoint diffs render fine with or without a remote; the aggregate (worktree/base-branch) review view stays broken either way — and with a remote pointing at a not-yet-existing upstream repo, the PR-context lookups just fail with a different error.
The underlying default-branch/diff-base resolution problem is better captured by #5616, which already has an open fix PR (#7394, resolving the default branch from the remote instead of a stale origin/HEAD). Closing this in favor of #5616.