feat(ui): gate OperationTiming.Shared behind a kill switch, off by default

Its job (surfacing the DetailsIsland.BindAsync churn) is done; leave the
InvokeTimedAsync wrappers and Island Record call sites in place as a
chokepoint for next time, but stop writing by default. Shared now only
writes when CLAUDEDO_OP_TIMING=1 is set; the constructor keeps enabled=true
so both TestSetup redirects and OperationTimingTests are unaffected.
This commit is contained in:
Mika Kuns
2026-08-17 08:30:02 +02:00
parent ec9ad1b0e1
commit 43fbfd3fa2
3 changed files with 34 additions and 3 deletions
@@ -96,6 +96,27 @@ public class OperationTimingTests
}
}
[Fact]
public void Record_DoesNothingWhenDisabled()
{
var dir = Path.Combine(Path.GetTempPath(), "claudedo_optiming_" + Guid.NewGuid().ToString("N"));
var path = Path.Combine(dir, "operation-timing.ndjson");
var sink = new OperationTiming(path, enabled: false);
try
{
var exception = Record.Exception(() => sink.Record("hub", "RunNow", TimeSpan.FromMilliseconds(1), ok: false));
Assert.Null(exception);
Assert.False(File.Exists(path));
Assert.False(Directory.Exists(dir));
}
finally
{
if (Directory.Exists(dir)) Directory.Delete(dir, recursive: true);
}
}
[Fact]
public void Record_SwallowsWriteFailureInsteadOfThrowing()
{