Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Shared checkout allows concurrent agents but blocks ref switching #48180

ClosedRson9(GitHub profile, opens in a new tab) opened this issue 1 comment

Area

Server / source control / worktree coordination

Steps to reproduce

  1. Open a project using a shared checkout.
  2. Start an agent that continues working in that checkout, for example a delegated agent.
  3. Before that agent finishes, use another thread or agent attached to the same checkout and try to switch to another Git ref.

Expected behavior

The checkout should have an explicit, consistent concurrency policy. If shared checkouts are supported, the user should either be able to switch safely or be clearly warned when the checkout is exclusively occupied. If switching is unsafe, the second agent should be automatically isolated in a worktree, or the UI should offer that option before starting it.

Actual behavior

Multiple agents can be started against and modify the same checkout, but a ref switch is rejected while another agent is still marked as working:

Git command failed in GitWorkflowService.switchRef: '<agent title>' is still working in this checkout. Wait for it to finish, or use a worktree for a separate branch.

The shared checkout can therefore be concurrently writable, while branch switching is checkout-exclusive. The conflict is only discovered when a later ref switch is attempted. Concurrent agents can also modify or commit against an unexpected branch before that point.

Impact

Major degradation or frequent failure: the checkout can be left unusable for branch-based work until the unrelated agent finishes, and concurrent work can contaminate the same working tree.

Version or commit

Not recorded; observed in the current T3 Code environment on 2026-12-03.

Environment

macOS; project checkout managed by T3 Code.

Workaround

Use a separate worktree for every concurrent agent, or wait for all agents sharing the checkout to finish before switching refs.

Notes

This appears to be an inconsistent checkout concurrency model rather than a request for a new feature: shared writes are allowed, but ref switching is guarded by an implicit exclusive lock.

  1. tanstack-source added labelsbug

  2. Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.

  3. juliusmarminge closed this

Sign in to join this conversation.