Repository navigation
[copilot] Refine agent guidance from session review - #13778
Draft
simonrozsival wants to merge 5 commits into
Draft
simonrozsival wants to merge 5 commits into
simonrozsival wants to merge 5 commits into
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Recurring findings from the agent session review: invalid performance comparisons (~13 findings), flaky-test fixes that erased the test's oracle or miscounted retries (~12), and removals that missed generated, packaging or CI consumers (~10). Co-authored-by: Copilot App <[email protected]>
Keep the agent-instruction changes in this PR and submit each on-demand skill separately for focused review. Co-authored-by: Copilot App <[email protected]>
Move the SourceLink workaround next to the standalone dotnet test commands and leave api-docs submodule guidance to #13780. Co-authored-by: Copilot App <[email protected]>
simonrozsival
added a commit
that referenced
this pull request
Nov 25, 2026
…13780) Context: #13778 `external/android-api-docs` is the repo's only submodule, and new git worktrees don't initialize it. Neither `make prepare` nor any agent instruction mentions it. Builds in such worktrees run for several minutes and then fail during packaging: ``` sharedfx.targets(413,5): error MSB4018: System.IO.FileNotFoundException: .../bin/Release/lib/xamarin.android/xbuild-frameworks/Microsoft.Android/37/Mono.Android.xml ``` `_ExportMsxDoc` reads `external/android-api-docs/docs/xml` (`src/Mono.Android/Mono.Android.targets`), so `Mono.Android.xml` is never produced. A review of local agent sessions found this pattern repeatedly: * 30 sessions ran `git submodule update --init external/android-api-docs` by hand, and 37 hit the error above. * Each occurrence cost about 10 minutes: a failed `make leeroy`, a search through a ~20k-line log, and a rebuild. * Some orchestration prompts had started carrying "`git submodule update --init --recursive` if needed" as a workaround. This adds one bullet to the `local-build` skill: in a new worktree, run `git submodule update --init` before building. The bullet includes the error text, so an agent that has already hit the failure can recognize it. The always-loaded instructions are unchanged. Making `make prepare` initialize the submodule would remove the step entirely, but it is a build-system change and is not part of this PR.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: #13521
Context: #13728
An expanded review of all stored conversation turns in 1,558 remaining local dotnet/android candidate sessions found recurring test-scope churn, overbuilt solutions, and build/environment validation pitfalls. The review used 50 subagents; 1,486 sessions had stored turns and 72 had none. The candidate filter can include non-coding conversations, and stored turns are not full raw tool transcripts.
Test and review guidance
Test additions repeatedly needed scope reductions when they duplicated existing coverage, asserted implementation shape, or used brittle GC-timing assumptions. The guidance now emphasizes unique behavioral or regression protection while preserving meaningful characterization tests. The code-review skill no longer requires a comment on clean PRs or a full-file read when relevant context is sufficient.
Build and runtime experiments
The review confirmed shared SDK/JDK path hazards and missing submodule prerequisites; local-build guidance now checks resolved paths (submodule setup is in #13780), and the tests skill now lists the SourceLink workaround next to standalone
dotnet test, where agents in fresh worktrees hit it. Historicalmake allfailures predate the existingmake leeroyguidance. In one requested runtime experiment, successful builds anddotnet test --no-buildexercised baseline rather than candidate artifacts, so the device skill now advises verifying manually replaced APK/native-library candidates.Correctness and shortening
Several review rules contained inaccurate MSBuild, TFM, test-fixture, JNI, GC, and Android stack claims; these were corrected. The always-loaded instructions now enable NRT for new code without converting existing code unless asked. Duplicated commands, examples, and unconditional rules were removed or shortened.
Net change: −139 lines (+57/−196);
copilot-instructions.mdshrinks from 287 to 150 lines.Validation:
git diff --checkpassed. Builds and tests were not run because this change only updates documentation and agent instructions.