Skip to content

Build mur offline; let loc translate fall back to an installed Copilot CLI - #1773

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 6 commits into
mainfrom
alzollin-microsoft-cli-offline-build-npm
Dec 1, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 6 commits into
mainfrom
alzollin-microsoft-cli-offline-build-npm

Conversation

@azchohfi

@azchohfi Alexandre Zollinger Chohfi (azchohfi) commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 4c33a7645ac541d0456b9352639d5ed5e4bd2fd7

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Simulated offline build succeeds in Debug and Release with REACTORCLI001; online build still bundles the runtime.
↑ 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_OptionsBothPagesPresent flake unrelated to this diff.
Diagnosis confidence 9/10 ↑ Reproduced: the SDK's BeforeBuild _DownloadCopilotCli fails the build with MSB3923 against an unreachable host.
↑ Confirmed shipped mur is published with CI=true and so lacks the runtime.
Evidence fit 8/10 ↑ The issue's MSB3923 symptom and the requested "actionable message / degraded-binary record" both map to this change.
↓ The issue cites an npm URL; SDK 1.0.34 now downloads from GitHub releases, so the exact log line differs.

Summary

src/Reactor.Cli no longer needs network access to build. GitHub.Copilot.SDK downloads the Copilot runtime in BeforeBuild, and an unreachable host failed the whole CLI build even though only mur loc translate uses that runtime.

  • Build: new src/Reactor.Cli/CopilotRuntime.targets probes the release (cold cache only) ahead of the SDK's targets. If it can't download SHA256SUMS.txt, or that file doesn't list this platform's archive, it skips the runtime with REACTORCLI001 (the probe's MSB3923 warning gives the reason) and the build succeeds. An explicit -p:CopilotSkipCliDownload=false keeps the strict SDK behaviour; the bootstrap workflow already sets it.
  • mur loc translate: new CopilotRuntimeLocator resolves COPILOT_CLI_PATH (must be a full path), then the bundled runtime, then a Copilot CLI in fixed gh/WinGet install locations (never PATH). Release builds of mur never bundled the runtime, so this also fixes loc translate there. 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 version mur was built for, instead of failing every batch.
  • mur doctor: reports which runtime loc translate will use.
  • bootstrap.ps1: warns when it packed mur without the runtime.
  • Docs: mur-cli guide, CONTRIBUTING, Directory.Build.props comment, 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), GetCopyToOutputDirectoryItems entry, 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/r on a cold cache: succeeded with MSB3923 + REACTORCLI001 warnings. With -p:CopilotSkipCliDownload=false it fails with MSB3923, as intended.
  • Online dotnet build src/Reactor.Cli -p:Platform=x64: runtime downloaded and bundled; mur loc translate --target fr-FR --model claude-haiku-4.5 translated "Hello, world" to "Bonjour le monde".
  • Same mur with its bundled runtime removed and COPILOT_CLI_PATH set to a copy of the 1.0.112 runtime: mur doctor reports it, and mur loc translate translated the same string (exit 0).
  • With the bundled runtime removed and no COPILOT_CLI_PATH, mur picks the WinGet-installed CLI. Locally that is 1.0.115, which fails the SDK 1.0.34 handshake; mur reports 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_PATH must now be a full path. Relative or bare-command values are rejected for mur loc translate, because a relative path would resolve inside the project being localized.
  • An online local build behaves as before. A build that can't download now succeeds without the runtime (warning, not error). Set CopilotSkipCliDownload=false for the old strict failure. If the host lists the archive's checksum but the archive download itself then fails, the SDK's own MSB3923 error still fails the build.
  • The installed-CLI fallback only works if that CLI is protocol-compatible with SDK 1.0.34. A newer one (for example 1.0.115) reports a version mismatch, which mur now explains.
  • The probe mirrors private SDK properties and the release URL shape. The pinned-version contract suite and the bootstrap workflow's packaged-runtime check guard against drift.

…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>
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build metrics

Artifact sizes for 4c33a76 vs the base branch (ecdb5de).

Packages (compressed .nupkg)

Artifact base PR Δ
Microsoft.UI.Reactor.nupkg 2.16 MB 2.16 MB -9 B (0.00%) ≈
Microsoft.UI.Reactor.Advanced.nupkg 530.2 KB 530.2 KB +3 B (0.00%) ≈
Microsoft.UI.Reactor.Devtools.nupkg 290.4 KB 290.4 KB -10 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor

Artifact base PR Δ
Microsoft.UI.Reactor.dll 2.92 MB 2.92 MB +0 B (0.00%) ≈
Reactor.Analyzers.dll 471.5 KB 471.5 KB +0 B (0.00%) ≈
Reactor.Localization.Generator.dll 16.0 KB 16.0 KB +0 B (0.00%) ≈
Reactor.Wrappers.Abstractions.dll 10.5 KB 10.5 KB +0 B (0.00%) ≈
Reactor.Wrappers.Generator.dll 164.0 KB 164.0 KB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Advanced

Artifact base PR Δ
Microsoft.UI.Reactor.Advanced.dll 1.08 MB 1.08 MB +0 B (0.00%) ≈

Assemblies in Microsoft.UI.Reactor.Devtools

Artifact base PR Δ
Microsoft.UI.Reactor.Devtools.dll 791.0 KB 791.0 KB +0 B (0.00%) ≈

No size change beyond the noise floor. ✅

✅ smaller / ⚠️ larger / ≈ within noise. Sizes come from a Release dotnet pack on the CI runner: packages are the compressed .nupkg download size, assemblies the uncompressed DLL inside it.
workflow run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 doctor and 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

Comment thread src/Reactor.Cli/CopilotRuntime.targets Resolved
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

🧪 Merged coverage

Coverage for 4c33a76 vs the base branch (ecdb5de) — unit + selftest merged.

Metric base PR Δ
Line 89.17% 89.16% -0.01 pp ≈
Branch 44.18% (18793/42539) 44.18% (18794/42539) 0.00 pp ≈

No coverage change beyond the noise floor. ✅

✅ higher / ⚠️ lower / ≈ within noise. Δ is in percentage points; coverage is unit + selftest merged (Debug x64) on the CI runner. Cobertura reports attached to the workflow run as artifacts.

- 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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The runtime check now causes no-op translation runs to fail when no runtime is installed, instead of exiting successfully when there is nothing to translate.

1 open issue

Review effort: Balanced

Comment thread src/Reactor.Cli/Loc/TranslateCommand.cs Resolved
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

@azchohfi Alexandre Zollinger Chohfi (azchohfi) added ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge and removed agent-preparing Agent is addressing feedback or completing required validation and CI labels Dec 1, 2026
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit 128d0a4 into main Dec 1, 2026
79 of 80 checks passed
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) deleted the alzollin-microsoft-cli-offline-build-npm branch December 1, 2026 03:57
@azchohfi Alexandre Zollinger Chohfi (azchohfi) removed the ready-for-review Agent work and technical checks complete; awaiting review, not approval or merge label Dec 1, 2026
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.

Reactor.Cli can't build offline: one command forces a build-time npm download

2 participants