Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Windows no longer pops up "git-remote-https.exe – 0xc0000142" every few refreshes. Codex
starts a `git ls-remote` for its plugin marketplace when the app server comes up, and the tray
killed the whole process tree the moment the limits arrived — often while that git was still
initialising. The tray now closes the server's stdin and waits up to ten seconds for it to
exit on its own; it only kills a server that lingers.

## [0.3.2] - 2026-08-19

A patch release for two things one screenshot showed at once: a rate limit the tray had been
Expand Down
18 changes: 17 additions & 1 deletion src/RateTray/Providers/CodexUsageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ await process.StandardInput.WriteLineAsync(
}
finally
{
TryKill(process);
await StopAsync(process).ConfigureAwait(false);
}

var diagnostics = await SafeAwait(stderr).ConfigureAwait(false);
Expand Down Expand Up @@ -308,6 +308,22 @@ private static void AddWindows(List<LimitReading> readings, JsonObject bucket, s
return candidates.FirstOrDefault(File.Exists);
}

/// <summary>
/// Closes stdin so the server exits on its own, and kills only if it lingers. An
/// immediate tree kill hits the <c>git ls-remote</c> codex spawns at startup for its
/// plugin marketplace mid-initialisation, and Windows answers with a 0xc0000142 popup.
/// </summary>
private static async Task StopAsync(Process process)
{
try { process.StandardInput.Close(); }
catch (Exception ex) when (ex is IOException or ObjectDisposedException) { }

try { await process.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(10)).ConfigureAwait(false); }
catch (TimeoutException) { }

TryKill(process);
}

private static void TryKill(Process process)
{
try
Expand Down
2 changes: 1 addition & 1 deletion tests/RateTray.E2E/RateTray.E2E.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.0" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/RateTray.Tests/RateTray.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
<PackageReference Include="coverlet.collector" Version="10.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="4.0.0" />
</ItemGroup>
Expand Down
Loading