Skip to content

[api] Fix named pipe / UDS creation - #64818

Merged
Andrew Branch (andrewbranch) merged 7 commits into
microsoft:mainfrom
andrewbranch:bug/api-pipe
Oct 14, 2026
Merged

Andrew Branch (andrewbranch) merged 7 commits into
microsoft:mainfrom
andrewbranch:bug/api-pipe

Conversation

@andrewbranch

Copy link
Copy Markdown
Member

One semi-related fix per commit.

  • af47f84: when creating a UDS for an API client, create a tmp directory first and set permissions on the socket path to 0o600
  • 058a1ed: when an LSP client asks for an API socket to be created by a specific name, interpret that as the name of the tmp directory to be created and make the socket path ${tmpdir}/socket, so the same strategy as above can be used
  • 416b013: use a random pipe name on Windows when spawning the sync API

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Repeated transport closure can delete a replacement Unix socket and prevent new connections.

1 open finding
What changed in this PR

Improves API transport creation for the native TypeScript compiler and language server.

Changes:

  • Creates private Unix socket directories with explicit permissions and cleanup.
  • Updates explicit Unix path semantics and documentation.
  • Randomizes Windows sync API pipe names.
File Description
tsc/​internal/​lsp/​server.go Creates private transports and returns their actual paths.
tsc/​internal/​lsp/​lsproto/​lsp_generated.go Documents Unix directory semantics.
tsc/​internal/​ipc/​transport.go Adds private transport creation and cleanup.
tsc/​internal/​ipc/​transport_windows.go Adapts Windows listener creation.
tsc/​internal/​ipc/​transport_unix.go Creates permission-restricted sockets and directories.
tsc/​internal/​ipc/​transport_unix_test.go Tests permissions, directory reuse rejection, and cleanup.
tsc/​internal/​api/​server.go Updates pipe option documentation.
tsc/​cmd/​tsc/​api.go Updates command-line pipe help.
tools/​scripts/​lsp/​generate.mts Updates protocol documentation generation.
packages/​typescript/​src/​api/​syncChannel.ts Uses randomized Windows pipe names.
Files not reviewed (1)
  • tsc/internal/lsp/lsproto/lsp_generated.go: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tsc/internal/ipc/transport.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Windows connectivity test lacks an Accept call, causing dialing to time out despite correct permissions.

1 open finding
1 resolved since last review
Files not reviewed (1)
  • tsc/internal/lsp/lsproto/lsp_generated.go: Generated file

🧠 Review effort: Balanced

Comment thread tsc/internal/ipc/transport_windows_test.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Cross-platform access controls and cleanup behavior need Unix and Windows validation that was not performed during this review.

0 open findings

1 resolved since last review
Files not reviewed (1)
  • tsc/internal/lsp/lsproto/lsp_generated.go: Generated file

🧠 Review effort: Balanced

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this is merged, see if we can do a cherry pick of this to release-7.0 (the bot won't let you do it until this is merged, but I bet it conflicts anyway)

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Oct 14, 2026
@andrewbranch
Andrew Branch (andrewbranch) added this pull request to the merge queue Oct 14, 2026
Merged via the queue into microsoft:main with commit 257e874 Oct 14, 2026
29 checks passed
@andrewbranch
Andrew Branch (andrewbranch) deleted the bug/api-pipe branch October 14, 2026 22:44
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Oct 14, 2026
@andrewbranch

Copy link
Copy Markdown
Member Author

TypeScript Bot (@typescript-bot) cherry-pick this to release-7.0

@typescript-automation

typescript-automation Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
cherry-pick this to release-7.0 ✅ Started ❌ Results

@typescript-automation

Copy link
Copy Markdown
Contributor

Hey, Andrew Branch (@andrewbranch)! I was unable to cherry-pick this PR.

Check the logs at: https://github.com/microsoft/TypeScript/actions/runs/38650096582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants