Replace per-poll REST calls in useLocalGitInfo with a persistent
WebSocket connection to /sockets/bash-events.
Previously, useQuery's refetchInterval:10_000 caused
AgentServerRuntimeService.executeCommand to fire individual HTTP
requests on every tick (find + 2 git commands × up to 3 candidate
dirs) to probe the workspace for git metadata.
Changes:
- websocket-url.ts: export buildBashWebSocketUrl() using the same
host/pathPrefix extraction as the conversation-events URL builder
- use-bash-command-runner.ts: new hook that maintains a persistent WS
connection to /sockets/bash-events and exposes runCommand(command,
cwd, timeout) → Promise. Commands queued during CONNECTING are
flushed on open; all in-flight commands are rejected on
close/error/unmount.
- use-local-git-info.ts: swap AgentServerRuntimeService.executeCommand
for useBashCommandRunner; keep refetchInterval:10_000 so branch
changes (e.g. git checkout) are still reflected without a full
refresh, but each probe now reuses the open socket rather than
opening new HTTP connections.
Co-authored-by: openhands <openhands@all-hands.dev>