fix(desktop): fix background tab spawning - #6590
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR stops browser and terminal automation from spawning replacement background tabs after users select the active surface. It also preserves existing resource selection during background activity and adds concise running-command labels for terminal close confirmations.
Confidence Score: 4/5The browser-tab change should be fixed before merging because unguarded navigation operations can replace a tab after the user has claimed it. User interaction still marks the active browser tab as claimed, but the changed session selectors return that tab directly and several navigation operations bypass the claim check already used by element actions. Files Needing Attention: apps/desktop/src/main/browser-agent/session.ts; packages/terminal-protocol/src/index.test.ts
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/browser-agent/session.ts | Removes background-tab forking, but leaves navigation operations able to mutate a user-claimed automation tab. |
| apps/desktop/src/main/terminal/index.ts | Reuses the selected terminal for agent operations while retaining command-busy and close protections. |
| apps/sim/app/workspace/[workspaceId]/home/home.tsx | Preserves an existing resource selection and records activity on other agent resources. |
| packages/terminal-protocol/src/index.ts | Adds a bounded best-effort parser for displaying concise running-program names. |
| packages/terminal-protocol/src/index.test.ts | Covers command-label parsing thoroughly but introduces a relative import contrary to repository policy. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
U[User interacts with active browser tab] --> C[Tab marked user-selected]
C --> A[automationTabId remains on same tab]
A --> T{Next browser tool}
T -->|Click/type/scroll| G[User-claim guard rejects action]
T -->|Navigate/open URL/back/forward| N[Navigation runs without claim guard]
N --> F[User-visible page or history changes]
Reviews (1): Last reviewed commit: "Update tab spawning" | Re-trigger Greptile
Summary
Fix background tab spawning
Type of Change
Testing
Manual
Checklist