fix: Project action terminal lifecycle (#3287)

* fix(terminal): make command sessions own action lifecycle

* fix(ui): reconcile project action terminal state

* feat(ui): show running project actions in terminal tabs

* feat(ui): run project actions from linked worktrees

* fix(ui): guard project action reconciliation

* fix(ui): scope project action preview fallback

* fix(ui): default project actions to worktrees

* fix(ui): reveal project action terminals

* fix(ui): retain terminal output after snapshot replay

* fix(ui): restore running action terminals on revisit
This commit is contained in:
Matt Visnovsky
2026-09-05 12:04:36 +03:00
committed by GitHub
parent 58dfc789a2
commit 4e0eed717d
53 changed files with 5194 additions and 608 deletions
@@ -18,4 +18,22 @@ describe('resolveProjectForSessionDirectory', () => {
expect(resolveProjectForSessionDirectory(projects, worktrees, '/workspace/openchamber-feature')).toEqual(projects[0]);
});
test('prefers registered worktree ownership over a containing project', () => {
const configuredProjects = [
{ id: 'home', path: '/Users/elfy', label: 'Home' },
{ id: 'infoscan', path: '/Users/elfy/GitRepos/infoscan', label: 'InfoScan' },
];
const worktreePath = '/Users/elfy/.local/share/opencode/worktree/refactor-self-hosted-runners';
const worktrees = new Map([
['/Users/elfy/GitRepos/infoscan', [{
path: worktreePath,
projectDirectory: '/Users/elfy/GitRepos/infoscan',
branch: 'refactor/self-hosted-runners',
label: 'refactor/self-hosted-runners',
}]],
]);
expect(resolveProjectForSessionDirectory(configuredProjects, worktrees, worktreePath)).toEqual(configuredProjects[1]);
});
});