[Bug] Agent mishandles branch creation, uses worktree instead of checkout and performs unsafe resets
Resolved 💬 1 comment Opened May 15, 2026 by shira-insait Closed May 15, 2026
Bug Description
Agent made a mess out of a simple request.
I asked to take changes to a new branch off main. The right answer was 3 commands (git stash, git checkout -b ... main, git stash pop) — exactly what I eventually had to do myself.
Instead the agent created a worktree (!!) I didn't ask for, then tried to clean it up with destructive ops that got hook-blocked, then made the working tree show 100+ changes by resetting blindly to main without thinking about what would happen and no recovery plan.
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.1.132
- Feedback ID: 0b182889-ab74-40fb-b430-3415625e1264
Errors
[{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3449)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T10:38:28.934Z"},{"error":"McpToolCallError: ### Error\nTimeoutError: browserBackend.callTool: Timeout 5000ms exceeded.\nCall log:\n\^[[2m - waiting for locator('aria-ref=e521')\^[[22m\n\^[[2m - locator resolved to <button role=\"radio\" type=\"button\" tabindex=\"-1\" value=\"encrypt\" aria-checked=\"false\" data-state=\"unchecked\" id=\"storage-mode-encrypt\" data-radix-collection-item=\"\" class=\"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sr-only\"></button>\^[[22m\n\^[[2m - attempting click action\^[[22m\n\^[[2m 2 × waiting for element to be visible, enabled and stable\^[[22m\n\^[[2m - element is visible, enabled and stable\^[[22m\n\^[[2m - scrolling into view if needed\^[[22m\n\^[[2m - done scrolling\^[[22m\n\^[[2m - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\^[[22m\n\^[[2m - retrying click action\^[[22m\n\^[[2m - waiting 20ms\^[[22m\n\^[[2m 2 × waiting for element to be visible, enabled and stable\^[[22m\n\^[[2m - element is visible, enabled and stable\^[[22m\n\^[[2m - scrolling into view if needed\^[[22m\n\^[[2m - done scrolling\^[[22m\n\^[[2m - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\^[[22m\n\^[[2m - retrying click action\^[[22m\n\^[[2m - waiting 100ms\^[[22m\n\^[[2m 9 × waiting for element to be visible, enabled and stable\^[[22m\n\^[[2m - element is visible, enabled and stable\^[[22m\n\^[[2m - scrolling into view if needed\^[[22m\n\^[[2m - done scrolling\^[[22m\n\^[[2m - <rect x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" width=\"18\" height=\"11\"></rect> from <div class=\"flex items-center gap-2\">…</div> subtree intercepts pointer events\^[[22m\n\^[[2m - retrying click action\^[[22m\n\^[[2m - waiting 500ms\^[[22m\n\n at xr5 (/$bunfs/root/src/entrypoints/cli.js:4905:63)\n at Fc7 (/$bunfs/root/src/entrypoints/cli.js:4905:1409)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-15T11:09:49.169Z"},{"error":"McpToolCallError: ### Error\nError: browserBackend.callTool: Error: strict mode violation: locator('[title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\"]') resolved to 4 elements:\n 1) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"7_spvZnr5QJ_dyUHuRB8H3uX2nKIkYgVNQso3Q8kOoA=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1\">…</span> aka getByText('IL BANK').first()\n 2) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"4Yw4B8c9B93-qNVIRjrxfXLJJpDRPMJ1FRaULfOR77k=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foreground border-border cursor-pointer hover:opacity-80 gap-1\">…</span> aka getByText('IL BANK').nth(1)\n 3) <span data-pii-type=\"IL_BANK_ACCOUNT\" data-encrypted=\"HueBpx0opEwAfkflHGt6tcr98MvCdYjb7kscFwX0Lm8=\" title=\"PII Type: IL_BANK_ACCOUNT (encrypted) — click to reveal\" class=\"inline-flex items-center px-1.5 py-0.5 mx-0.5 rounded text-xs font-medium border bg-muted text-muted-foregrou…
Note: Content was truncated.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗