Skip to content

docs: document the .NET Framework close-code limit on terminal sockets - #953

Merged
Blind-Striker merged 2 commits into
masterfrom
docs/934-net472-close-codes
Nov 17, 2026
Merged

Blind-Striker merged 2 commits into
masterfrom
docs/934-net472-close-codes

Conversation

@Blind-Striker

Copy link
Copy Markdown
Collaborator

📝 Description

What does this PR do?

It documents a .NET Framework platform limit on terminal sockets, as the maintainer decided in #934 (option b: document it, add no mapping and no new transport).

On .NET Framework, a server close with 1012, 1013 or 1014 makes ClientWebSocket throw a WebSocketException (native error 0x83760002) and leaves the socket Aborted. .NET 10 and later receive the close normally. opencode closes location-borrowing sockets with 1012 location shut down on a reload.

What it changes for callers:

  • Both terminal families still end in OpenCodeTransportException on every target.
  • On .NET 10+, the exception names the close status and reason ("closed abnormally with status 1012 (location shut down)").
  • On .NET Framework, it comes from the socket-fault mapping instead ("could not be read"), and carries the WebSocketException as its inner exception, so the status and reason are lost.
  • Client-hosted MCP retries either way.

Docs:

  • docs/architecture/client-runtime.md, PTY WebSocket session: a ".NET Framework close-code limit" bullet, the canonical statement.
  • docs/guide/terminals.md: a short relay where the guide describes closes, linking to the canon.

Related Issue(s):

🔄 Type of Change

  • 📚 Documentation update

🎯 Protocol & API Surface

  • No public API change
  • No generated output changed
  • The pinned snapshot (spec/) is untouched
  • Nothing under external/ was hand-edited

🧪 Testing

  • No code or test change. The documentation-reading tool tests pass (canon description sources, door remarks, snippet compile guard, consumer pins, README guide table).
  • The behaviour itself is already characterized by the client-hosted MCP live test on .NET Framework (the native error code on a 1012 close).

✅ Completion Gate

  • The local check in quality-gates.md passes on this head, rebased on master: whitespace, format/style, clones, slopwatch, the release build, all test projects, the API snapshots, generate --verify, the fixed point, Extensions and Native AOT.

📚 Documentation

  • The canonical owner is client-runtime.md; the guide relays it
  • CHANGELOG.md: no entry. The documented behaviour already ships unchanged, and the CHANGELOG records user-facing changes.

✅ Code Quality Checklist

  • No new analyzer warnings, and no new suppressions
  • Branch is up to date with the target branch, no merge conflicts
  • Commit messages carry no AI-attribution trailers

🔍 Additional Notes

Breaking Changes: none. Dependencies: none.

@Blind-Striker
Blind-Striker added this pull request to the merge queue Nov 17, 2026
Merged via the queue into master with commit f5a26b8 Nov 17, 2026
13 checks passed
@Blind-Striker
Blind-Striker deleted the docs/934-net472-close-codes branch November 17, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

net472: a server close with 1012 ends terminal sockets in a transport exception

1 participant