Files
OpenHands/__tests__/utils
Robert Brennanandopenhands 22aa64f482 Conversation control bar: surface local git remote/branch + diff against HEAD (#166)
* Show local git remote/branch in conversation control bar

For conversations started from a local workspace (no selected_repository
on the conversation), shell out via the agent server's bash-execute
endpoint to read 'git remote get-url origin' and the current branch from
the conversation's working dir, and use them to populate the repo and
branch chips in the chat git control bar.

- New parseGitRemoteUrl util maps remote URLs to {host, owner/repo,
  provider}, recognizing github/gitlab/bitbucket/azure cloud hosts.
- New useLocalGitInfo query hook runs only when the conversation lacks a
  selected_repository, has a working_dir, and the runtime is ready.
  Failures (non-git checkout, etc.) silently fall back to the existing
  'No repo / No branch' display.
- GitControlBar layers the local fallback after conversation/task data
  but keeps pull/push/PR gated on conversation/task data only, so we
  don't enable provider-specific flows for repos the agent didn't clone.
- Repo/branch buttons now render the detected name even when no provider
  is known; the external-link styling is reserved for cases where we can
  build a real URL.

Co-authored-by: openhands <openhands@all-hands.dev>

* Bump typescript-client and request HEAD ref for git changes

Update @openhands/typescript-client from 7d20f11 to 6b9603f (latest main)
to pick up the new optional 'ref' option on RemoteWorkspace.gitChanges
and gitDiff. Pass { ref: 'HEAD' } from both the V1 and legacy git-service
adapters (and the cloud-proxy query strings) so the Changes panel shows
working tree + index versus the latest commit (i.e. staged + unstaged)
instead of diffing against the auto-detected upstream/default branch.

Co-authored-by: openhands <openhands@all-hands.dev>

* chore(lint): prettier nits in use-local-git-info

Co-authored-by: openhands <openhands@all-hands.dev>

* Refactor git remote URL normalization

---------

Co-authored-by: openhands <openhands@all-hands.dev>
2026-05-07 23:01:10 -07:00
..