Repository navigation
Closed
Labels
Description
Summary
The web UI Review tab spins forever on "loading changes" when the session directory is not a git repository (e.g. a working directory containing multiple service repos). Both backing APIs return empty data, but the UI never renders an empty state. Related: there is no way to switch the Review scope to a different repo without moving the whole session.
Environment
- opencode version: 2.0.3 (background service, healthy;
serve --service, pid confirmed via/api/health) - OS: Linux 6.18.33.2-microsoft-standard-WSL2 x86_64
- Terminal: TERM=xterm-256color
- Shell: /bin/bash
- Install/channel: latest (npm
@opencode/cli);opencode2beta build also present but the serving instance is 2.0.3 - Active plugins: none found in config
Reproduction
- Open (or move) a session whose
location.directoryis a plain directory that is NOT a git repository — e.g./root/workwhich contains multiple independent service repos/worktrees (git rev-parse→fatal: not a git repository). - Open the web UI (served by the same server, e.g.
http://127.0.0.1:49374, Basic auth useropencode) and click the Review tab (审查). - The panel shows "loading changes" indefinitely.
Expected Behavior
- When there is nothing to review, the panel should render an empty state (e.g. "no changes") instead of loading forever.
- Ideally the Review scope can be switched to a specific repo (location) without moving the session, since VCS routes are already location-scoped and
POST /api/session/{sessionID}/moveexists for changing the project directory.
Actual Behavior
- Infinite loading spinner; no empty state, no error.
- Backing API evidence (all via
opencode api, which uses the same discovery+auth flow as first-party clients):GET /api/session/{id}/diff→{"data":[]}GET /api/vcs/status→{"location":{...,"directory":"/root",...},"data":[]}(project resolves away from the non-git session dir, empty file list)GET /api/vcs/diffwithoutmode→400 InvalidRequestError "Missing key at [\"mode\"]"(mode is required:working | branch | committed)
Additional Context
- Frequency: consistent — reproduces every time the session directory has no git repo.
- The empty-data case likely misses an empty-state branch in the web client; the fetch itself succeeds (200 with
[]), so this looks like a frontend handling gap rather than a server error. No error lines related to vcs/diff in~/.local/share/opencode/log/opencode.log(role=server). - Workaround tried: none helps in place; reviewing per-repo requires opening a session scoped to that repo directory (one session per project directory, matching the
session/movedesign) or falling back togit status/git diffin a terminal. - Related feature ask: allow the Review tab to pick/switch the repo (location) when the session directory spans multiple repos.
Activity
github-actions commentedon Sep 16, 2026
This issue might be related to existing issues around non-git directory handling. Please check:
global//)If your specific symptom (Review tab stuck on "loading changes" with no empty-state render) is already tracked in one of those, consider adding a comment there instead.
Hona commentedon Sep 22, 2026
Fixed by #50265 (
fix(app): show empty review state for projects without VCS), merged tov2as 8aebed1 on 2026-09-21. Closing manually becausev2is not the default branch, so the PR did not auto-close this issue.