fix: Changes tab uses correct workspace directory after repo switch (Fix #1193)#1261
fix: Changes tab uses correct workspace directory after repo switch (Fix #1193)#1261HeyItsChloe wants to merge 6 commits into
Conversation
When switching repositories, selectedRepository is updated immediately but workingDir is updated later by the agent after cloning. The old logic preferred workingDir over selectedRepository, causing the Changes tab to show the wrong directory during the transition window. Now getGitPath computes the path from selectedRepository whenever a repo is selected, avoiding stale workingDir issues during repo switches. Fixes #1193
Use Fix #5 pattern - fetch fresh conversation data directly via batchGetAppConversations (like VSCode tab does) instead of relying on cached useActiveConversation() data. This fixes stale cache issues where workspace.working_dir lags behind after a repo switch, causing the Changes tab to show the wrong directory. Changes: - Revert get-git-path.ts to original priority (workingDir first) - Update use-unified-get-git-changes.ts to fetch fresh data - Update tests to reflect original behavior Fixes #1193
When the agent autonomously clones a repo (not via UI), selected_repository is not set. However, localGitInfo probe detects the repo via git commands. This fix ensures the repo bar renders when localGitInfo detects a repo, even if selected_repository wasn't set via UI. Changes: - Added localGitDetectedRepo check to showRepoButton condition - Updated isRepoButtonInert to consider localGitDetectedRepo Fixes issue where repo bar doesn't render after agent clones a repo
Added two test cases: 1. Shows repo button when localGitInfo detects a repository 2. Button is NOT disabled when localGitInfo detects repo
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
PR Artifacts Notice This PR contains a
|
✅ Mock-LLM E2E Tests43/43 passed Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
🔶 Mock-LLM Docker E2E Test Results37/42 passed · 5 skipped Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
Fixes issue where all files show in diff tab when switching repositories. The queryKey now includes gitPath so React Query detects when the repository changes and refetches with the correct directory. Also resets orderedChanges when gitPath changes to prevent stale items from appearing from previous repository.
✅ Mock-LLM E2E Tests43/43 passed Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
🔶 Mock-LLM Docker E2E Test Results37/42 passed · 5 skipped Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
Ensures repo bar renders after switching repositories by forcing useLocalGitInfo to refetch and detect the new repository.
✅ Mock-LLM E2E Tests43/43 passed Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |
📸 Snapshot Test ReportWarning Snapshot comparison step crashed (timeout, OOM, or runner error) — diff results below may be incomplete or absent. ❌ 4 snapshots differ from the main branch baselines. Add the
🔴 Changed snapshots (4)
|
| Expected (main) | Actual (PR) | Diff |
|---|---|---|
![]() |
![]() |
![]() |
settings-verification — 3 snapshots
condenser-settings
| Expected (main) | Actual (PR) | Diff |
|---|---|---|
![]() |
![]() |
![]() |
verification-settings-off
| Expected (main) | Actual (PR) | Diff |
|---|---|---|
![]() |
![]() |
![]() |
verification-settings-on
| Expected (main) | Actual (PR) | Diff |
|---|---|---|
![]() |
![]() |
![]() |
✅ Unchanged snapshots (70)
archived-conversation
- conversation-panel-with-archived-badges
- conversation-view-archived
- conversation-view-sandbox-error
automations
- automations-delete-modal
- automations-list-active-inactive
- automations-no-automations
- automations-search-no-results
backends-extended
- backend-add-blank-disabled
- backend-add-cloud-advanced-open
- backend-add-cloud-no-key-disabled
- backend-add-cloud-with-key-enabled
- backend-add-form-partially-filled
- backend-add-invalid-url-disabled
- backend-add-local-ready
- backend-add-name-only-disabled
- backend-add-two-column-layout
- backend-add-whitespace-host-disabled
- backend-after-switch
- backend-cancel-nothing-saved
- backend-edit-prefilled
- backend-manage-after-removal
- backend-manage-two-listed
- backend-remove-cancelled
- backend-remove-confirmation
- backend-switch-overlay
backends
- backend-add-modal
- backend-manage-modal
- backend-selector-open
changes-tab
- changes-deleted-file
- changes-diff-viewer
- changes-empty
collapsible-thinking
- reasoning-content-collapsed
- reasoning-content-expanded
- think-action-collapsed
- think-action-expanded
mcp-page
- mcp-custom-server-1-editor-open
- mcp-custom-server-2-url-filled
- mcp-custom-server-3-all-filled
- mcp-custom-server-4-installed
- mcp-custom-server-editor
- mcp-empty-installed
- mcp-search-filtered
- mcp-slack-install-1-marketplace
- mcp-slack-install-2-modal
- mcp-slack-install-3-filled
- mcp-slack-install-4-installed
onboarding
- onboarding-step-0-check-backend
- onboarding-step-1-choose-agent
- onboarding-step-2-setup-llm
- onboarding-step-3-say-hello
projects-workspace-browser
- projects-workspace-browser
settings-page
- add-backend-modal
- analytics-consent-modal
- home-screen
- settings-app-page
- settings-page
settings-secrets
- secrets-add-form-filled
- secrets-add-form
- secrets-after-save
- secrets-delete-confirm
- secrets-list
settings-verification
- verification-settings-critic-enabled
sidebar
- sidebar-collapsed
- sidebar-conversation-panel
- sidebar-filter-menu
skills-page
- skills-empty
- skills-loaded
- skills-no-match
- skills-search-filtered
- skills-type-filter
Generated by the Snapshot Tests workflow. This comment was created by an AI agent (OpenHands) on behalf of the repo maintainers.
🔶 Mock-LLM Docker E2E Test Results37/42 passed · 5 skipped Commit:
Posted by the Mock-LLM E2E workflow · results are deterministic (scripted LLM responses) |












See original PR description
🐳 Docker images for this PR
• GHCR package: https://github.com/OpenHands/agent-canvas/pkgs/container/agent-canvas
ghcr.io/openhands/agent-canvasghcr.io/openhands/agent-server:1.26.0-pythonopenhands-automation==1.0.0a672130fbccc55b4353a27142903dc605c861d83a4Pull (multi-arch manifest)
# Multi-arch manifest — Docker automatically pulls the correct architecture docker pull ghcr.io/openhands/agent-canvas:sha-72130fbRun
All tags pushed for this build
About Multi-Architecture Support
sha-72130fb) is a multi-arch manifest supporting both amd64 and arm64sha-72130fb-amd64) are also available if needed