Conversation
🔍 PR Review Squad — Round 1PR SummaryThree-fix PR addressing reported issues:
CI StatusBuild & Tests
Findings
Cleared Concerns
Suggested Fix for N1The simplest fix is to split the template — the internal static string BuildServerFallbackNotice(string? serverError, string logPath, string reason = "couldn't start", bool embeddedFallback = true)
{
var detail = string.IsNullOrEmpty(serverError) ? "" : $"\n\nError: {serverError}";
var fallbackClause = embeddedFallback
? " — fell back to Embedded mode. Your sessions won't persist across restarts."
: " — reconnection failed.";
return $"Persistent server {reason}{fallbackClause}{detail}\n\nLogs: {logPath}\n\nGo to Settings → Save & Reconnect to fix.";
}Then pass Test Coverage4 new unit tests cover Verdict:
|
PR #427 -- Round 2 Re-Review (Aggregated)New commit since Round 1: Round 1 Findings Status
Build & Tests
New Findings: NoneAll Round 1 issues addressed correctly. No new issues found. Verdict: ✅ Approve Review by PR Review Squad (5 workers, multi-model consensus) |
…re, session create error Issue #420 (crash on macOS 15 — FoundationModels missing): - Upgrade Microsoft.Maui.Essentials.AI from 26126.2 to 26157.2 - The 26126.2 binary hard-links FoundationModels.framework (no 'weak' flag) so dyld aborts on macOS 15 before any managed code runs. The 26157.2 build (released March 7) already ships with FoundationModels as a weak-linked dependency, allowing the app to load on older macOS without Apple Intelligence. Issue #424 ("Failed to start server" with no useful error info): - ServerManager.StartServerAsync now captures process stderr into LastError - IServerManager exposes LastError property - FallbackNotice for persistent-server failures now includes the actual error message and the path to the event-diagnostics.log file so users can self-diagnose without filing a bug - Dashboard shows a "View Logs" button on the fallback-notice card that opens the ~/.polypilot/ log directory in Finder/Explorer Issue #425 ("Service not initialized" error hidden on first Create attempt): - Root cause: CreateSessionForm.TriggerCreate() always set isExpanded=false after OnCreate.InvokeAsync(), collapsing the form before Blazor could render the CreateError that the parent just set. Error only appeared on second click. - Fix: Remove auto-collapse from TriggerCreate; add public CollapseOnSuccess() method that the parent calls explicitly only after a successful session creation. - HandleCreateSession and HandleCreateGroup now call createSessionFormRef .CollapseOnSuccess() on the success path. Also: - Fix flaky UrgencySortTests test class: add [Collection("BaseDir")] to prevent race with other BaseDir-mutating test classes running in parallel All 2923 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…der; extract BuildServerFallbackNotice helper - Settings.razor StartServer() now shows the actual error from ServerManager.LastError with a 10s dismiss and log path fallback (instead of plain 'Failed to start server') - Add 'View Logs' button in Settings Persistent Server section → opens ~/.polypilot/ in Finder - Extract CopilotService.BuildServerFallbackNotice() static helper used by all three FallbackNotice-setting sites (InitializeAsync, server recovery, server restart) - Add 4 unit tests for BuildServerFallbackNotice covering error content, log path, empty error, and custom reason string Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ths to BuildServerFallbackNotice - Remove duplicate 'Go to Settings' appended after BuildServerFallbackNotice (the helper already includes Settings guidance), fixing double-text user-visible bug - Migrate all remaining hardcoded FallbackNotice error assignments to use the helper: * Version mismatch restart failed (line ~905) -- adds log path * Version mismatch fallback to Embedded (line ~914) -- adds log path * Recovery catch block (line ~1228) -- now includes ex.Message as error detail * Restart connection failure (line ~1322) -- now includes ex.Message as error detail - Every error-path FallbackNotice now consistently shows: reason, optional error detail, log file path, and Settings guidance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ard Linux fallback, stderr grace period N1 (MODERATE): BuildServerFallbackNotice now takes embeddedFallback parameter (default true). Five non-Embedded call sites now pass embeddedFallback: false so they no longer incorrectly say 'fell back to Embedded mode. Your sessions won't persist across restarts.' — those paths keep the server down but don't switch to Embedded mode. Two Embedded sites (lines 845, 914) retain embeddedFallback: true. Added 2 new tests covering embeddedFallback=true and embeddedFallback=false behavior. N2 (MINOR): Dashboard.OpenLogsFolder now shows the log directory path inline for 8 seconds on Linux/GTK platforms (matching Settings.razor's ShowStatus fallback). Added _openLogsStatus field; button markup shows the status string when set. N3 (MINOR): ServerManager.StartServerAsync now awaits Task.WhenAny(t2, Task.Delay(500)) before reading stderrLines after the 15s timeout, giving the stderr drain task a 500ms grace window to capture any final output from the failing server process. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
crash.log had no size limit — it appends on every unhandled exception. Now rotates at 5 MB: old file moved to crash.log.old (one backup kept), matching the pattern used by event-diagnostics.log (10 MB) and plugin.log (5 MB). All other polypilot logs already have size management: - event-diagnostics.log: deletes at 10 MB - plugin.log: rotates at 5 MB with .old backup - console.log: truncated by nohup redirect on each relaunch - audit_logs/: daily rotation + 30-day purge on startup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
57a17af to
2ce12dd
Compare
PR #427 — Round 3 ReviewNew commit since Round 2 (✅ Approve): New Commit AnalysisThe new commit adds 8 lines to Potential edge cases checked:
Round 1 + Round 2 Findings: All ✅ FIXED (from prior reviews)
New Findings: NoneCI: No checks configured on branch. Verdict: ✅ Approve New commit is clean and consistent with existing log management patterns. Review by PR Review Squad — Worker 5 |
- Removed View Logs button from Dashboard FallbackNotice banner - Added new 'Diagnostics' section at bottom of Settings page - Renamed button to 'Open Log Folder' with folder icon - Added guidance text explaining each log file: - event-diagnostics.log: session & server diagnostics - crash.log: unhandled exceptions - console.log: general app output - Searchable via Settings search (logs, diagnostics, troubleshoot, etc.) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR #427 — Round 4 Re-ReviewNew commits since Round 3 (✅ Approved):
Tests: ✅ 2929 passing, 0 failing Prior Findings Status
New Findings🟢 MINOR —
|
…tics in Release (#433) ## Summary Fixes the "Failed to start server: ErrorStartingProcess, copilot, No such file or directory" error reported by @roji when installing PolyPilot via Homebrew. Also fixes `event-diagnostics.log` never being created in Release builds (oversight from PR #427). --- ### Bug 1 — Bundled copilot CLI not found in AOT builds **Root cause:** In Release/AOT Mac Catalyst builds, `Assembly.Location` for `GitHub.Copilot.SDK` either returns empty (when the `.dll` is stripped entirely) or points to a `.xamarin/maccatalyst-{arch}/` subdirectory. The copilot binary lives in `MonoBundle/` root. `ResolveBundledCliPath()` only checked paths relative to `Assembly.Location`, so it missed the binary. Both `ServerManager.FindCopilotBinary()` and `CreateClient()` then fell back to bare `"copilot"` → ENOENT → server fails → embedded fallback fails → `IsInitialized = false` → every session creation throws "Service not initialized." **Fix:** Added `AppContext.BaseDirectory` as a third fallback in `ResolveBundledCliPath()`. It always points to `MonoBundle/` regardless of build config or AOT stripping. ### Bug 2 — `event-diagnostics.log` missing in Release builds **Root cause:** The diagnostic log writer in `Debug()` was wrapped in `#if DEBUG` (added Feb 18 as a dev-only feature). PR #427 then added 8 `BuildServerFallbackNotice` references telling users to check this log file — but it never exists in Release builds. **Fix:** Removed the `#if DEBUG` guard. The log already has a 10MB rotation guard. Also expanded the filter to capture `[ERROR]`, `[ABORT]`, `[BRIDGE]`, and `"Failed to"` messages so initialization failures are logged. ### Diagnostic logging Added `Console.WriteLine` logging in `ServerManager.FindCopilotBinary()` showing which path was selected and, when the bundled binary is not found, logging `Assembly.Location` and `AppContext.BaseDirectory` for diagnosis. --- ### Tests - 3 new tests for `AppContext.BaseDirectory` fallback behavior - All 2938 tests pass (1 pre-existing flaky timing test) --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Fixes three issues filed by @roji against PolyPilot v1.0.11 (installed via Homebrew).
Fixes #420, Fixes #424, Fixes #425
Issue #420 — Crash on macOS 15.7.4 (FoundationModels missing)
Root cause:
Microsoft.Maui.Essentials.AIv10.0.50-ci.main.26126.2 bundles a native framework with a hard (LC_LOAD_DYLIB) dependency onFoundationModels.framework, which only exists on macOS 26+. On macOS 15.x, dyld aborts at launch before any managed code runs.Fix: Updated
Microsoft.Maui.Essentials.AIto v10.0.50-ci.main.26157.2, which linksFoundationModelsasLC_LOAD_WEAK_DYLIB— the app loads on older macOS and gracefully degrades (PolyPilot doesn't call any EssentialsAI APIs directly).Issue #424 — "Failed to start server" with no useful error info
Changes:
ServerManager.StartServerAsyncnow captures stderr into aLastErrorproperty instead of discarding it silentlyIServerManagerexposesstring? LastError { get; }FallbackNoticeerror assignments inCopilotServicenow use a sharedBuildServerFallbackNotice(error, logPath, reason)helper that consistently surfaces: the error reason, the actual error text (when available), the path to~/.polypilot/event-diagnostics.log, and Settings guidanceStartServer()button now shows the actual error with a 10s dismiss (e.g."Failed to start server: Port 4321 already in use") instead of the generic message~/.polypilot/in Finder/ExplorerIssue #425 — Session creation error hidden on first attempt
Root cause:
CreateSessionForm.TriggerCreate()resetisExpanded = falseimmediately afterOnCreate.InvokeAsync(). Blazor parameter updates (CreateError) arrive in the next render cycle, so the form collapsed before the error could be shown. On the second click, the persisted error state became visible.Fix:
TriggerCreate()public void CollapseOnSuccess()method toCreateSessionFormSessionSidebar.HandleCreateSessionandHandleCreateGroupnow callCollapseOnSuccess()only after verifying success — error leaves the form open and visible immediatelyTests
BuildServerFallbackNotice: verifies error text, log path, empty-error handling, and custom reason stringUrgencySortTestsmissing[Collection("BaseDir")]attribute)