Fix hidden browser automation paintability (#2851)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Jinwoo Hong
2026-05-26 16:27:23 -07:00
committed by GitHub
co-authored by Orca
parent 2d9aed70ea
commit c134b1c31d
25 changed files with 1094 additions and 114 deletions
+39
View File
@@ -7854,6 +7854,45 @@ describe('OrcaRuntimeService', () => {
}
})
it('resolves an exact path selector when duplicate repo entries expose the same path', async () => {
const runtime = new OrcaRuntimeService(store)
const duplicatePath = '/tmp/workspaces/runtime-duplicate-selector'
const getRepos = vi.spyOn(store, 'getRepos').mockReturnValue([
{
id: TEST_REPO_ID,
path: TEST_REPO_PATH,
displayName: 'repo',
badgeColor: 'blue',
addedAt: 1
},
{
id: 'repo-duplicate-entry',
path: '/tmp/repo-secondary-worktree',
displayName: 'repo-secondary-worktree',
badgeColor: 'red',
addedAt: 2
}
])
vi.mocked(listWorktrees).mockResolvedValue([
{
path: duplicatePath,
head: 'def',
branch: 'runtime-duplicate-selector',
isBare: false,
isMainWorktree: false
}
])
try {
const worktree = await runtime.showManagedWorktree(`path:${duplicatePath}`)
expect(worktree.id).toBe(`${TEST_REPO_ID}::${duplicatePath}`)
expect(worktree.path).toBe(duplicatePath)
} finally {
getRepos.mockRestore()
}
})
it('keeps CLI-created worktrees successful when initial terminal creation fails', async () => {
const runtime = new OrcaRuntimeService(store)
const spawn = vi.fn().mockRejectedValue(new Error('pty unavailable'))