anomalyco / anomalyco/opencode
web: Review tab stuck loading when session directory is not a git repo
Open
@Hona is already working on this.
Since Sep 16, 2026.
2.0
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.