Skip to content

Fix Android crash and safe area insets, update MAUI to 10.0.31#8

Merged
PureWeen merged 1 commit intomainfrom
android-safe-area-fix
Feb 8, 2026
Merged

Fix Android crash and safe area insets, update MAUI to 10.0.31#8
PureWeen merged 1 commit intomainfrom
android-safe-area-fix

Conversation

@PureWeen
Copy link
Owner

@PureWeen PureWeen commented Feb 8, 2026

Changes

  • Fix Android TypeInitializerException: Static readonly path fields in CopilotService and ServerManager crashed on Android because Environment.GetFolderPath(UserProfile) returns empty. Converted to lazy properties with Android-safe fallbacks (LocalApplicationDataPersonalAndroid.App.Application.Context.FilesDir).

  • Fix safe area insets: Set SafeAreaEdges="Container" on ContentPage. This is a .NET 10 breaking change where ContentPage defaults to None (edge-to-edge), causing the navbar to overlap the status bar.

  • Update MAUI to 10.0.31: Pinned Microsoft.Maui.Controls and Microsoft.AspNetCore.Components.WebView.Maui to explicit 10.0.31.

  • Android connection defaults: Added #if ANDROID fallback to force Persistent mode with remote server connection.

- Fix TypeInitializerException on Android: convert static readonly path fields
  to lazy properties, add Android-safe path fallbacks
- Fix safe area insets: use SafeAreaEdges="Container" on ContentPage (.NET 10
  breaking change where ContentPage defaults to None/edge-to-edge)
- Update MAUI packages from $(MauiVersion) to explicit 10.0.31
- Add Android-specific connection defaults (remote persistent server)
- Add GetTempPath() fallback in ServerManager for Android
@PureWeen PureWeen merged commit 5351af6 into main Feb 8, 2026
PureWeen added a commit that referenced this pull request Feb 20, 2026
Concurrency fixes:
- Swap _sessions before wiring event handler on reconnect (#2)
- Block ALL events from orphaned handlers, not just terminal (#3)
- Add lock(_imageQueueLock) to all image queue mutations (#4)
  including dequeue, reinsert, ClearQueue, rename, close, dispose
- Clear IsResumed on error and watchdog paths (#5)
- Add RunContinuationsAsynchronously to remaining TCS (#6)

Architecture/contract fixes:
- Add [JsonIgnore] to ShouldWarnOnStall, LastSimilarity (#7)
- Fix ConsecutiveErrors increment-before-check ordering (#8)
- Set IsCancelled on all non-success termination paths (#10)
  including stall, error-stall, max-iteration, OperationCanceled,
  empty-assignment error stall, and single-agent StopReflectionCycle
- Add session dir deletion for ghost evaluator pruning (#12)
- Add CompletedAt to StopReflectionCycle (#12 related)

Already correct (no changes needed):
- #9: CurrentIteration == 1 check was already fixed
- #11: Comments already reference string-based stall detection

Documentation:
- Update stall detection from 'hash match' to 'string equality'
- Update error handling to show ConsecutiveErrors (not ConsecutiveStalls)
- Add IsCancelled invariant to exit conditions table
- Add 5 new invariants: orphan gate, reconnect ordering,
  image queue locking, IsResumed clearing, TCS creation
- Document empty-assignment retry behavior

817/817 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PureWeen added a commit that referenced this pull request Mar 7, 2026
…t groups (#297)

## Problem

When sending a message to an orchestrator session from the **mobile
app** (via WebSocket bridge), the message went directly to instead of
through the multi-agent dispatch pipeline. The orchestrator responded as
a normal chat session — no worker dispatch, no task planning, no
synthesis.

This was the root cause of the PR Review Squad orchestrator not working
after the latest deploy.

## Root Cause

`WsBridgeServer.HandleClientMessage` called `SendPromptAsync` directly
via `Task.Run`, completely bypassing the orchestration routing that
exists in `Dashboard.razor`. The bridge had no awareness of orchestrator
sessions.

**Evidence from diagnostics:**
- Successful orchestrator sends: thread=1 (UI thread, via
Dashboard.razor → orchestration pipeline)
- Failed sends at 02:00/02:04: thread=44/65 (background, from `Task.Run`
in WsBridgeServer)
- No `[DISPATCH-ROUTE]` or `[DISPATCH]` logs — orchestration pipeline
never executed

## Fix

1. **`WsBridgeServer.cs`** — Now calls `GetOrchestratorGroupId()` before
sending. If the target session is an orchestrator, routes through
`SendToMultiAgentGroupAsync` instead of direct `SendPromptAsync`.
2. **`CopilotService.cs`** (CreateSessionAsync queue drain) — Same
pattern for newly created orchestrator sessions.
3. **`RightClickContextMenuTests.cs`** — Fix pre-existing test failure
(proximity threshold too tight after new attributes were added to the
session-item div).

## Tests

- 4 new unit tests in `MultiAgentRegressionTests.cs` (Bug #8 region)
- 3 new integration tests in `WsBridgeIntegrationTests.cs` (bridge
orchestration routing)
- Fix for 1 pre-existing test failure
- **All 2066 tests passing**

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant