Skip to content

refactor: align the stop option's Pty name and mode type with upstream - #897

Merged
Blind-Striker merged 1 commit into
masterfrom
refactor/842-stop-pty-rename
Nov 15, 2026
Merged

Blind-Striker merged 1 commit into
masterfrom
refactor/842-stop-pty-rename

Conversation

@Blind-Striker

Copy link
Copy Markdown
Collaborator

Renames the background-service stop option to upstream's name. Nothing has shipped with the old names (they arrived after 1.1.0), so there is nothing to keep compatible.

Refs #842

The rename

  • OpenCodeServerStopOptions.PersistentPtys → OpenCodeServerStopOptions.Pty
  • OpenCodeServerStopPersistentPtyMode → OpenCodeServerStopPtyMode. The members Clear = 0 and Handoff = 1 are unchanged.

Upstream at the pin (v2.3.0) has the same option as StopOptions.pty?: "clear" | "handoff" (packages/client/src/service.ts:37-43).

Not renamed: the persistent-terminal family keeps its names. That is OpenCodeClient.PersistentPtys, PersistentPtysClient, the OpenCode.Sdk.PersistentPtys namespace, the generated files and PersistentPtyListResponse.PersistentPtys. The edit is symbol-aware, not a text replace.

Reading Pty correctly: OpenCodeClient.Ptys is the ordinary terminal family, so the new XML summary and the connection-modes options row both say that Pty governs persistent terminals (OpenCodeClient.PersistentPtys) only, and that ordinary terminals end with the service either way. Upstream's pty: "clear" | "handoff" mapping and the null/Clear behaviour move into the remarks.

What changes

  • OpenCodeServerStopPtyMode.cs, renamed with git mv.
  • OpenCodeServerStopOptions, and the refusal message in ServiceStopper, which now names OpenCodeServerStopOptions.Pty.
  • A cref in OpenCodeServer.BackgroundService.cs.
  • The generator's reserved-name registry entry.
  • PublicApi.verified.txt: the two stop entries only.
  • ServiceStopperTests:
    • every use is renamed, with no assertion or expected value changed;
    • one test name follows the rename: StopAsync_Should_Refuse_An_Undefined_Persistent_Pty_Mode_Before_Reading → StopAsync_Should_Refuse_An_Undefined_Pty_Mode_Before_Reading.
  • The CHANGELOG ✨ Added line, client-runtime.md (two sentences) and the connection-modes guide (the stop sequence, the options row and the example).

No behaviour changes, and there is no new suppression, baseline entry or clone.

Verification

The local check from quality-gates.md ran on Linux (net10.0 and net11.0), on b8d5f838 over master 3fa64db5, with SDK 11.0.100 and Bun 1.4.4 at the pin:

  • Slopwatch: 0 issues.
  • Release build: 0 warnings.
  • Both format passes, and verify-clones: 0 new.
  • --help, and generate --verify: current.
  • OpenCode.Sdk.Tools.Tests except NativeAot: 2,819 passed.
  • OpenCode.Sdk.Tests: 4,236 passed on each of net10.0 and net11.0.
  • The ServiceElection pass: 9 passed on each.

Total 11,309 passed, with none failed or skipped. net472 is this PR's CI Windows leg.

@Blind-Striker Blind-Striker added this to the Next milestone Nov 15, 2026
@Blind-Striker
Blind-Striker added this pull request to the merge queue Nov 15, 2026
Merged via the queue into master with commit c734f4b Nov 15, 2026
17 checks passed
@Blind-Striker
Blind-Striker deleted the refactor/842-stop-pty-rename branch November 15, 2026 11:38
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.

1 participant