When a macOS LaunchAgent silently unloads after sleep or extended idle,
`gateway start` and `gateway restart` would bail with 'not loaded'
hints instead of attempting recovery — even though the plist still
exists on disk and `repairLaunchAgentBootstrap()` can re-register it.
Changes:
- Add optional `repairNotLoaded` method to `GatewayService` interface
- Wire darwin implementation: checks plist exists, calls
`repairLaunchAgentBootstrap()` (enable + bootstrap + kickstart)
- `runServiceStart()`: when service is not loaded but repair succeeds,
proceed with normal start flow instead of printing install hints
- `runServiceRestart()`: when `onNotLoaded` returns null (no running
process to signal) but repair succeeds, proceed with restart flow
- Both paths are best-effort: if repair fails or throws, falls through
to existing not-loaded behavior (no regression)
Fixes#43602
`chat.inject` called `appendAssistantTranscriptMessage` with
`createIfMissing: false`, causing a hard error when the transcript
file did not exist on disk despite having a valid `transcriptPath`
in session metadata. This commonly happens with ACP oneshot/run
sessions where the session entry is created but the transcript file
is not yet materialized.
The fix is a one-character change: `createIfMissing: true`. The
`ensureTranscriptFile` helper already handles directory creation
and file initialization safely.
Fixes#36170
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
fix(macos): prevent PortGuardian from killing Docker Desktop in remote mode (#6755)
PortGuardian.sweep() was killing non-SSH processes holding the gateway
port in remote mode. When the gateway runs in a Docker container,
`com.docker.backend` owns the port-forward, so this could shut down
Docker Desktop entirely.
Changes:
- accept any process on the gateway port in remote mode
- add a defense-in-depth guard to skip kills in remote mode
- update remote-mode port diagnostics/reporting to match
- add regression coverage for Docker and local-mode behavior
- add a changelog entry for the fix
Co-Authored-By: ImLukeF <92253590+ImLukeF@users.noreply.github.com>