Repository navigation
Build mur offline; let loc translate fall back to an installed Copilot CLI - #1773
Conversation
…t CLI (fixes #1133) GitHub.Copilot.SDK downloads the Copilot runtime in BeforeBuild, so an unreachable release host failed the whole CLI build with MSB3923 even though only 'mur loc translate' uses the runtime. - src/Reactor.Cli/CopilotRuntime.targets probes the release on a cold cache and, if unreachable, skips the download with REACTORCLI001. An explicit CopilotSkipCliDownload=false keeps the strict behaviour. - CopilotRuntimeLocator resolves COPILOT_CLI_PATH, the bundled runtime, then a Copilot CLI in fixed install locations (never PATH). - loc translate fails once, up front, when no runtime is found or it will not start, naming the runtime version mur was built for. - mur doctor reports which runtime loc translate will use. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Locator: pick the bundled folder by OS architecture (as the SDK does); reject blank or relative COPILOT_CLI_PATH values. - translate: abort on a start failure only before any batch ran, so finished translations are kept; advice now fits release builds of mur and the COPILOT_CLI_PATH case; provider factory seam for tests. - Probe: keep the MSB3923 reason visible, tailor REACTORCLI001 when a mirror is set, treat the cache as warm only when the SDK would, copy the SDK's unstable-version pattern verbatim, rename the timeout knob to CopilotRuntimeProbeTimeoutSeconds. - mur doctor: testable runtime check with a fix step. - bootstrap.ps1 warns when it packed mur without the runtime. - Contract suite: local HTTP server for the success and 404 branches, GetCopyToOutputDirectoryItems entry, partial cache, csproj import gate; workflow also triggers on Reactor.Cli.csproj. - Docs: release mur needs an installed Copilot CLI; doctor row; stale CONTRIBUTING and Directory.Build.props text. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
📦 Build metricsArtifact sizes for Packages (compressed .nupkg)
Assemblies in Microsoft.UI.Reactor
Assemblies in Microsoft.UI.Reactor.Advanced
Assemblies in Microsoft.UI.Reactor.Devtools
No size change beyond the noise floor. ✅ ✅ smaller / |
There was a problem hiding this comment.
🟡 Changes recommended
Runtime archive download failures can still abort builds instead of emitting REACTORCLI001, and mixed runtime layouts can select an unusable bundled CLI over a working installed one.
2 open issues
What changed in this PR
Addresses #1133 by reducing mur builds’ dependence on the optional Copilot runtime and adding installed-CLI fallback for mur loc translate.
Changes:
- Adds a release-download probe that skips runtime bundling when unreachable, while preserving explicit strict mode.
- Adds runtime discovery, startup diagnostics, and runtime reporting in
mur doctorand bootstrap. - Adds contract and unit tests, CI triggers, and supporting documentation.
| File | Description |
|---|---|
| tests/Reactor.Tests/Localization/CopilotRuntimeLocatorTests.cs | Tests runtime selection, diagnostics, and translation failure handling. |
| tests/build_props/ci/CopilotSdkContract.Tests.ps1 | Tests offline probing, cache handling, and strict-mode behavior. |
| src/Reactor.Cli/Reactor.Cli.csproj | Imports runtime targets and records the expected runtime version. |
| src/Reactor.Cli/Loc/TranslateCommand.cs | Resolves the runtime and reports initial startup failures once. |
| src/Reactor.Cli/Loc/CopilotTranslationProvider.cs | Accepts an explicit CLI path and wraps startup failures. |
| src/Reactor.Cli/Loc/CopilotRuntimeLocator.cs | Locates bundled or installed runtimes and formats diagnostics. |
| src/Reactor.Cli/Doctor/DoctorCommand.cs | Reports the translation runtime’s location or absence. |
| src/Reactor.Cli/CopilotRuntime.targets | Adds the download probe and offline fallback warning. |
| samples/apps/widget-creator/Services/CopilotSdkClient.cs | Corrects comments about SDK runtime resolution. |
| docs/guide/mur-cli.md | Updates the generated runtime setup guide. |
| docs/_pipeline/templates/mur-cli.md.dt | Documents runtime precedence and doctor reporting. |
| Directory.Build.props | Updates comments explaining download-skip behavior. |
| CONTRIBUTING.md | Documents offline builds and strict-mode controls. |
| CHANGELOG.md | Records build and translation behavior changes. |
| bootstrap.ps1 | Warns when the packed tool lacks a runtime. |
| .github/workflows/build-props-lib-tests.yml | Expands triggers to cover runtime targets and project changes. |
Review effort: Balanced
🧪 Merged coverageCoverage for
No coverage change beyond the noise floor. ✅ ✅ higher / |
- Probe: also require SHA256SUMS.txt to list exactly one checksum for this platform's archive (the SDK fails the build otherwise), and report it in REACTORCLI001. - Locator: count a marked explicit CLI as bundled only when neither runtime-pair file exists, as the SDK does. - Tests: Path.Join over Path.Combine; report temp cleanup failures. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The installed-CLI fallback needs a successful Windows end-to-end translation with a protocol-compatible CLI, since the reported validation only reached a failed SDK handshake.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
…i-offline-build-npm # Conflicts: # CHANGELOG.md
A run with nothing to translate (for example --missing-only against a fully translated locale) no longer fails just because no runtime is installed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…i-offline-build-npm
There was a problem hiding this comment.
🔵 Needs a closer look
The installed-CLI fallback needs end-to-end translation validation with a protocol-compatible CLI, including on Windows, because the tested version failed its handshake.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
128d0a4
into
main

Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
4c33a7645ac541d0456b9352639d5ed5e4bd2fd7↑ End-to-end translations succeeded with the bundled runtime and with an explicitly supplied CLI (
COPILOT_CLI_PATH), which uses the same launch path as the installed-CLI fallback.↑ 31 network-free contract cases and 343 Localization/CLI unit tests pass; key oracles mutation-checked.
↓ The WinGet-installed CLI available locally (1.0.115) is protocol-incompatible with SDK 1.0.34, so the installed-path discovery was verified by unit tests, not with a live compatible install.
↓ CI's AOT Selftests (3/4) hit a known
ConnectedNav_OptionsBothPagesPresentflake unrelated to this diff._DownloadCopilotClifails the build with MSB3923 against an unreachable host.↑ Confirmed shipped mur is published with CI=true and so lacks the runtime.
↓ The issue cites an npm URL; SDK 1.0.34 now downloads from GitHub releases, so the exact log line differs.
Summary
src/Reactor.Clino longer needs network access to build.GitHub.Copilot.SDKdownloads the Copilot runtime inBeforeBuild, and an unreachable host failed the whole CLI build even though onlymur loc translateuses that runtime.src/Reactor.Cli/CopilotRuntime.targetsprobes the release (cold cache only) ahead of the SDK's targets. If it can't downloadSHA256SUMS.txt, or that file doesn't list this platform's archive, it skips the runtime withREACTORCLI001(the probe'sMSB3923warning gives the reason) and the build succeeds. An explicit-p:CopilotSkipCliDownload=falsekeeps the strict SDK behaviour; the bootstrap workflow already sets it.mur loc translate: newCopilotRuntimeLocatorresolvesCOPILOT_CLI_PATH(must be a full path), then the bundled runtime, then a Copilot CLI in fixed gh/WinGet install locations (neverPATH). Release builds ofmurnever bundled the runtime, so this also fixesloc translatethere. The runtime is resolved at the first batch that needs translating: a run with nothing to translate succeeds without one, and a missing runtime, or one that won't start before any batch ran, is reported once with a fix and the runtime versionmurwas built for, instead of failing every batch.mur doctor: reports which runtimeloc translatewill use.bootstrap.ps1: warns when it packedmurwithout the runtime.mur-cliguide, CONTRIBUTING,Directory.Build.propscomment, CHANGELOG.Linked issue / spec
Fixes #1133
Test plan
pwsh tests/build_props/ci/CopilotSdkContract.Tests.ps1: 31 passed, 0 failed. Covers unreachable host, a local mirror (success, 404, checksums missing this platform, unstable tag),GetCopyToOutputDirectoryItemsentry, warm and partial cache, strict mode, and the csproj import gate. Mutating the skip condition, hooks, cache check or checksum check each turned it red.dotnet test tests/Reactor.Tests --filter-namespace Microsoft.UI.Reactor.Tests.Localization --filter-namespace Microsoft.UI.Reactor.Tests.Cli: 343 passed. New tests were mutation-checked (no-op run without a runtime, abort filter, provider wrapper, CLI-path plumbing, explicit-CLI layout).dotnet build tests/Reactor.Tests --no-restore -c Release -p:Platform=x64: succeeded.dotnet build src/Reactor.Cli -c Release -p:Platform=x64 -p:CopilotCliReleaseBaseUrl=https://127.0.0.1:1/ron a cold cache: succeeded withMSB3923+REACTORCLI001warnings. With-p:CopilotSkipCliDownload=falseit fails withMSB3923, as intended.dotnet build src/Reactor.Cli -p:Platform=x64: runtime downloaded and bundled;mur loc translate --target fr-FR --model claude-haiku-4.5translated "Hello, world" to "Bonjour le monde".COPILOT_CLI_PATHset to a copy of the 1.0.112 runtime:mur doctorreports it, andmur loc translatetranslated the same string (exit 0).COPILOT_CLI_PATH,murpicks the WinGet-installed CLI. Locally that is 1.0.115, which fails the SDK 1.0.34 handshake;murreports the version mismatch once and stops.dotnet run --project tools/Reactor.DocPipeline -- compile --topic mur-cli --no-screenshots: compiled guide committed.Risk / breaking changes
COPILOT_CLI_PATHmust now be a full path. Relative or bare-command values are rejected formur loc translate, because a relative path would resolve inside the project being localized.CopilotSkipCliDownload=falsefor the old strict failure. If the host lists the archive's checksum but the archive download itself then fails, the SDK's ownMSB3923error still fails the build.murnow explains.