Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🤖 bug: same-backend rename/remove can race an in-flight native terminal or editor open

Closed
#4,909 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
desktop

Research direction

Start by tracing TerminalService.openNativeAdmitted and WorkspaceService.recordExternalEditorOpenAdmitted, then read workspaceUseLeases.ts and the existing pendingNativeTerminalOpens/pendingExternalEditorRecordings handling. Verify how same-backend rename and removal are gated, and run the relevant existing tests if found. Done means mutation cannot race either launcher and the counts remain until the launcher returns.

Written by the indexing model from the issue text.

Description

backlog

Problem

Follow-up from the review of #4907 (#4902). This backend's own rename and removal ignore its own terminal and editor use leases (by design: they tolerate or end this backend's terminals). So nothing on the same backend makes them wait for a native-terminal or external-editor open that is already past its gate probe:

  • TerminalService.openNativeAdmitted: after the last gate probe, the open still awaits the durable marker write and the launcher. A rename or removal started in that window can move or delete the checkout, and the terminal launches at the old namedWorkspacePath.
  • WorkspaceService.recordExternalEditorOpenAdmitted: after the lease, the marker write and the client round-trip are still in flight, and the launcher uses the path the client already has.

Other backends are not affected: their mutation gate refuses while this backend holds the lease (Dekker ordering in workspaceUseLeases.ts). There is no data loss; the terminal or editor opens at a path that no longer exists. This window existed before #4900 and #4907; those PRs only moved the probe.

Possible fix

Make same-backend rename and removal refuse (or wait) while pendingNativeTerminalOpens / pendingExternalEditorRecordings count an in-flight open for the workspace, as model-facing archive already does, and keep the count until the launcher returns.

Refs #4902, #4907


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Dominant language
TypeScript
Stars
2k
Forks
139
Avg merge
6h 58m
Merged PRs (30d)
774

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/xum

All issues in coder/xum

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.