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
22 changes: 22 additions & 0 deletions Models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ class EvalData

enum PagerAction { Quit, Browse, Resume }

enum SessionDbType { CopilotCli, SkillValidator, Unknown }

record BrowserSession(
string Id,
string Summary,
string Cwd,
DateTime UpdatedAt,
string EventsPath,
long FileSize,
string Branch,
string Repository,
SessionDbType DbType = SessionDbType.CopilotCli,
string? SkillName = null,
string? ScenarioName = null,
string? Role = null,
string? Model = null,
string? Status = null,
string? Prompt = null,
string? MetricsJson = null,
string? JudgeJson = null,
string? PairwiseJson = null);

// ========== JSON output records ==========
record TurnOutput(
int turn,
Expand Down
385 changes: 334 additions & 51 deletions SessionBrowser.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion TextUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public static string ExtractContentString(JsonElement el)

public static string SafeGetString(JsonElement el, string prop)
{
if (el.TryGetProperty(prop, out var v) && v.ValueKind == JsonValueKind.String)
if (el.ValueKind == JsonValueKind.Object && el.TryGetProperty(prop, out var v) && v.ValueKind == JsonValueKind.String)
return v.GetString() ?? "";
return "";
}
Expand Down
2 changes: 1 addition & 1 deletion replay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ replay stats <files...> [options]
(no args) Browse recent Copilot CLI sessions

Options:
--db <path> Browse sessions from an external session-store.db file
--db <path> Browse sessions from a session-store.db or skill-validator sessions.db
--tail <N> Show only the last N conversation turns
--expand-tools Show tool arguments, results, and thinking/reasoning
--full Don't truncate tool output (use with --expand-tools)
Expand Down
4 changes: 2 additions & 2 deletions tests/DbPathTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void HelpText_IncludesDbFlag()
var (stdout, stderr) = RunReplayWithArgs("--help");

Assert.Contains("--db", stdout);
Assert.Contains("Browse sessions from an external session-store.db file", stdout);
Assert.Contains("Browse sessions from a session-store.db or skill-validator sessions.db", stdout);
}

// Helper to create an empty DB file
Expand All @@ -74,7 +74,7 @@ private string CreateEmptyDbFile()
var startInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"run --project {ReplayCs} -- {args}",
Arguments = $"run -v q --project {ReplayCs} -- {args}",
RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true, // Need to redirect input too for proper TTY detection
Expand Down
2 changes: 1 addition & 1 deletion tests/EdgeCaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ private string RunReplayWithArgs(string args)
var startInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"run --project {ReplayCs} -- {args}",
Arguments = $"run -v q --project {ReplayCs} -- {args}",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
Expand Down
2 changes: 1 addition & 1 deletion tests/JsonOutputTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private string RunReplayWithArgs(string args)
var startInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"run --project {ReplayCs} -- {args}",
Arguments = $"run -v q --project {ReplayCs} -- {args}",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
Expand Down
2 changes: 1 addition & 1 deletion tests/SummaryOutputTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ private string RunReplayWithArgs(string args)
var startInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = "dotnet",
Arguments = $"run --project {ReplayCs} -- {args}",
Arguments = $"run -v q --project {ReplayCs} -- {args}",
RedirectStandardOutput = true,
RedirectStandardError = true,
UseShellExecute = false,
Expand Down