Skip to content

chore: use .NET 11 Process APIs to simplify dev.cs - #6070

Merged
jamescrosswell merged 2 commits into
mainfrom
ai/triagent-5363
Dec 3, 2026
Merged

jamescrosswell merged 2 commits into
mainfrom
ai/triagent-5363

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

dev.cs now uses the .NET 11 one-shot Process.RunAsync API (the repo already pins the 11.0.100 GA SDK) instead of hand-rolled process plumbing:

  • RunProcessAsync calls Process.RunAsync(fileName, arguments) rather than building a ProcessStartInfo and waiting on it.
  • IsCommandAvailableAsync calls Process.RunAsync(finder, [command], silent: true), which drops the manual Task.WhenAll(ReadToEndAsync, ReadToEndAsync, WaitForExitAsync) stream draining.
  • Commands pass their arguments as lists rather than pre-quoted strings, so the solution path no longer needs manual quoting.
  • cleanslate and aiup now run dotagents --project install. Since dotagents 3.0 a bare install targets ~/.agents, so the skills in agents.toml were never installed into the repo.

Checked on macOS: cleanslate --dry-run, wrest -n (detects sudo via which), subup, and remove-hooks with the key already unset (git's exit code 5 is still treated as success). The Windows cmd.exe /c path is unchanged in behaviour but wasn't run locally.

#skip-changelog

Closes #5363

🤖 Generated with Claude Code

Replaces the hand-rolled ProcessStartInfo plumbing and manual stream
draining with Process.RunAsync, and passes arguments as lists instead
of pre-quoted strings.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: low PR risk score: low label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: low

For commit 0ab1eaf.

This label is a hint for reviewers, not an approval.

@sentry-junior sentry-junior Bot 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.

Good to approve, with optional comments

Replaces the hand-rolled ProcessStartInfo plumbing in dev.cs with the .NET 11 Process.RunAsync overloads (GA in the pinned 11.0.100 SDK, so the preview caveat in #5363 no longer applies), and fixes cleanslate/aiup to install skills into the repo with dotagents --project install. This fully addresses #5363 at the cause.

  • Optional: dev.cs RunProcessAsync Windows branch (["/c", fileName, .. arguments]): passing a list to cmd.exe relies on ArgumentList quoting, which only quotes arguments containing spaces or quotes. That matches the old string for current callers, but it hasn't been run on Windows yet. A quick ./dev.cs wrest or subup on Windows would confirm it.
  • Optional: dev.cs cleanslate/aiup: --project before install matches the documented dotagents [--project|--global|--user] <command> usage. Since npx @sentry/dotagents isn't version-pinned, an older locally cached dotagents could reject or ignore the flag; pinning a minimum version (e.g. @sentry/dotagents@3) would make that deterministic.
  • Optional: no automated coverage for dev.cs. Acceptable for a dev-only script; --dry-run paths still print the expected commands.

This is an automated preliminary review.

@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.52%. Comparing base (4ef7835) to head (0ab1eaf).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6070      +/-   ##
==========================================
+ Coverage   78.46%   78.52%   +0.05%     
==========================================
  Files         537      539       +2     
  Lines       20167    20196      +29     
  Branches     4056     4064       +8     
==========================================
+ Hits        15825    15859      +34     
+ Misses       3494     3491       -3     
+ Partials      848      846       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jamescrosswell
jamescrosswell marked this pull request as ready for review December 1, 2026 21:35
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: low PR risk score: low labels Dec 1, 2026

@ric-oliv ric-oliv 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.

Looking good!

Comment thread dev.cs Outdated
("git clean", "git", ["clean", "-dfx"]),
("git submodule update", "git", ["submodule", "update", "--init", "--recursive"]),
("dotnet restore", "dotnet", ["restore", solution]),
("npx @sentry/dotagents install", "npx", ["@sentry/dotagents", "install"])

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.

Optional, and this was already broken before this PR. Since dotagents 3.0, a bare install writes to ~/.agents instead of the repo, so cleanslate never installs the skills in our agents.toml. Adding --project fixes it:

Suggested change
("npx @sentry/dotagents install", "npx", ["@sentry/dotagents", "install"])
("npx @sentry/dotagents --project install", "npx", ["@sentry/dotagents", "--project", "install"])

Comment thread dev.cs Outdated
{
Console.WriteLine("[dev] Installing/updating AI agent files");
return RunStepAsync("npx @sentry/dotagents install", "npx", "@sentry/dotagents install", options.DryRun);
return RunStepAsync("npx @sentry/dotagents install", "npx", ["@sentry/dotagents", "install"], options.DryRun);

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.

Same fix for aiup:

Suggested change
return RunStepAsync("npx @sentry/dotagents install", "npx", ["@sentry/dotagents", "install"], options.DryRun);
return RunStepAsync("npx @sentry/dotagents --project install", "npx", ["@sentry/dotagents", "--project", "install"], options.DryRun);

dotagents 3.0 defaults every command to global scope, so a bare
`install` never installed the skills in agents.toml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added risk: low PR risk score: low and removed risk: low PR risk score: low labels Dec 3, 2026
@jamescrosswell
jamescrosswell merged commit c464461 into main Dec 3, 2026
43 checks passed
@jamescrosswell
jamescrosswell deleted the ai/triagent-5363 branch December 3, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Use .NET 11 Process APIs to simplify dev.cs

2 participants