Skip to content

Continuation of #1136#1491

Closed
SteveSandersonMS wants to merge 2 commits into
mainfrom
stevesa/pr/1136
Closed

Continuation of #1136#1491
SteveSandersonMS wants to merge 2 commits into
mainfrom
stevesa/pr/1136

Conversation

@SteveSandersonMS
Copy link
Copy Markdown
Contributor

Creating a new PR because the old one was stuck on a CodeQL check

xoofx and others added 2 commits May 29, 2026 09:46
Iteratively refined the PR per inline review:

Client.cs
- Simplify ProcessStderrPump: drop IDisposable, remove _disposeRequested
  field, deferred-dispose ContinueWith machinery, and the try/catch
  (ObjectDisposedException) in Cancel(). The CancellationTokenSource has
  no CancelAfter and no registrations after ReadLineAsync exits, so GC
  with the pump is sufficient. Drop the matching
  finally { stderrPump.Dispose(); } block in CleanupCliProcessAsync.
- Consolidate PumpAsync catches into one `catch (Exception e) when
  (cancellationToken.IsCancellationRequested && e is ...)`.
- Refactor both read loops to `while (await ... is string line)`:
  - PumpAsync (stderr pump)
  - StartCliServerAsync port-wait loop; EOF handling moves out of the
    loop body and triggers via `detectedLocalhostTcpPort is null`.
- Revert error text to `Runtime process exited unexpectedly` and the
  three `CLI stderr pump` log messages to `runtime stderr pump` to
  match origin/main wording.
- Replace `var detectedLocalhostTcpPort = (int?)null;` with
  `int? detectedLocalhostTcpPort = null;`.

Polyfills/DownlevelExtensions.cs
- Add DownlevelTaskExtensions with WaitAsync on Task and Task<T>. Use a
  single linked CancellationTokenSource (no separate timeoutCts) and
  `CancellationToken cancellationToken = default` to avoid an extra
  overload. The Task<T> overload delegates to the Task overload via
  `((Task)task).WaitAsync(...)`.

test/Polyfills/TaskExtensions.cs
- Delete the test-only polyfill; the src polyfill now covers Task<T>
  for net472 (test pulls Polyfills/*.cs into the test assembly).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 29, 2026 08:49
@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner May 29, 2026 08:49
@SteveSandersonMS
Copy link
Copy Markdown
Contributor Author

Didn't work.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR modifies only .NET internal implementation files (dotnet/src/Client.cs, dotnet/src/Polyfills/DownlevelExtensions.cs) with no public API surface changes.

The changes refactor internal stderr handling into a ProcessStderrPump class with proper cancellation support and shutdown timeout — a .NET-specific implementation detail. No new public methods, options, or behaviors are introduced that would need to be replicated in Node.js, Python, or Go.

No cross-SDK consistency issues found.

Generated by SDK Consistency Review Agent for issue #1491 · ● 2.2M ·

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.

4 participants