You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Branch name in TUI footer / sidebar does not refresh after switching branches #31469
Describe the bug
After running git checkout <branch> (or equivalent) outside of OpenCode, the branch name displayed in the bottom-right corner of the TUI (home footer and sidebar footer) does not update to reflect the new branch. The stale branch name persists until OpenCode is restarted or the user navigates to a different session and back.
The breakage is in packages/opencode/src/cli/cmd/tui/context/sync.tsx, line 367:
case"vcs.branch.updated": {if(workspace===project.workspace.current()){// ← blocks the updatesetStore("vcs",{branch: event.properties.branch})}break}
workspace from the event is always undefined — the local VCS InstanceState has no WorkspaceRef injected.
Once the user opens a session, project.workspace.current() is set to a real workspace ID.
undefined !== "some-workspace-id" → false → the store is never updated.
Even on the home screen (where both are undefined), timing issues can cause the update to be missed.
The fix would be to either remove the workspace guard for this event type (the event is already scoped to the correct project by event.ts:19), or change it to only block when a non-matching workspace is explicitly set on both sides.
Expected behavior
The branch name (and directory path containing it) in the TUI footer and sidebar should update automatically within a few seconds of switching branches, without requiring a restart or session navigation.
Plugins
No response
OpenCode version
1.16.2
Steps to reproduce
Open OpenCode in a git repository (TUI mode).
Observe the bottom-right footer showing ~/repo:main (or similar).
In a separate terminal, run git checkout other-branch.
Return to OpenCode — the footer still shows ~/repo:main instead of ~/repo:other-branch.
Activity
tdi commentedon Jun 23, 2026
this explains why
branchinworkspacetable is always empty ? I make branches always using git terminal outside.github-actions commentedon Aug 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.