refactor(ui): remove the stale-worker banner
The banner compared the running worker's build SHA against the selected list's HEAD via a git ancestor check on every list switch and reconnect. It added a git-rev-parse MSBuild target, a hub call, and a poll loop for a corner case that hasn't come up in practice — not worth the moving parts.
This commit is contained in:
@@ -35,18 +35,4 @@
|
||||
<InternalsVisibleTo Include="ClaudeDo.Worker.Tests" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Stamps this worker's exact commit into AssemblyInformationalVersion as "+{sha}" so a
|
||||
running instance can report which commit it was built from (see WorkerHub.GetWorkerBuildInfo).
|
||||
Independent of MinVer: MinVerVersionOverride (release builds) replaces the base version but
|
||||
doesn't touch SourceRevisionId, and the SDK appends it to InformationalVersion regardless. -->
|
||||
<Target Name="SetBuildRevisionFromGit" BeforeTargets="GetAssemblyVersion" Condition="'$(SourceRevisionId)' == ''">
|
||||
<Exec Command="git rev-parse HEAD"
|
||||
WorkingDirectory="$(MSBuildProjectDirectory)"
|
||||
ConsoleToMSBuild="true"
|
||||
StandardOutputImportance="low"
|
||||
ContinueOnError="WarnAndContinue">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="SourceRevisionId" />
|
||||
</Exec>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -35,20 +35,6 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
private static readonly string Version =
|
||||
Assembly.GetExecutingAssembly().GetName().Version?.ToString(3) ?? "0.0.0";
|
||||
|
||||
// SourceRevisionId (set by ClaudeDo.Worker.csproj's git-rev-parse build target) is appended
|
||||
// by the SDK to InformationalVersion as "+{sha}" -- take the segment after the LAST '+' so
|
||||
// this stays correct even when MinVer's own pre-release metadata already contains a '+'.
|
||||
private static readonly string? BuildSha = ParseBuildSha(
|
||||
Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion);
|
||||
|
||||
internal static string? ParseBuildSha(string? informationalVersion)
|
||||
{
|
||||
if (string.IsNullOrEmpty(informationalVersion)) return null;
|
||||
var plusIndex = informationalVersion.LastIndexOf('+');
|
||||
if (plusIndex < 0 || plusIndex == informationalVersion.Length - 1) return null;
|
||||
return informationalVersion[(plusIndex + 1)..];
|
||||
}
|
||||
|
||||
private readonly QueueService _queue;
|
||||
private readonly IQueueWaker _waker;
|
||||
private readonly AgentFileService _agentService;
|
||||
@@ -233,11 +219,6 @@ public sealed class WorkerHub : Microsoft.AspNetCore.SignalR.Hub
|
||||
|
||||
public string Ping() => $"pong v{Version}";
|
||||
|
||||
/// <summary>Lets the UI detect a worker that's still running an older build than the code it's
|
||||
/// comparing against (e.g. a just-merged main) — a separate diagnostic rather than extending
|
||||
/// Ping's "pong vX.Y.Z" text, since that format isn't ours to break for any existing caller.</summary>
|
||||
public WorkerBuildInfoDto GetWorkerBuildInfo() => new(BuildSha);
|
||||
|
||||
public IReadOnlyList<ActiveTaskDto> GetActive()
|
||||
{
|
||||
return _queue.GetActive()
|
||||
|
||||
Reference in New Issue
Block a user