Tool

Copilot Workflow Rescue

Four common Copilot failures, each with the checks that tell them apart. Answer four questions and get the three things to try first, a prompt written for your stack, and a list of what to look at afterwards.

What is going wrong?

Chooses the prompt's language, the commands in the checklist and the lesson at the end.

Clients differ in what they read and where the controls are. Unsupported ones get general checks and are told so.

Answer the two questions above for the sharper version — or press the button now for the general plan.

An example result, with example answers — not anyone's real plan.

This tool has reviewed, environment-specific guidance for the clients listed on this workflow only. For the one you chose, the checks below are the general ones — verify anything client-specific against your own documentation.

Do these three, in order

Possible explanations — none of these is a diagnosis

Prompt to paste into Copilot

Edit it before you send it — the angle brackets are yours to fill in.

Check afterwards

For your setup

Next

Where this comes from, and what it cannot tell you

Product behaviour verified against:

This plan came from four answers. Nothing here read your repository, ran Copilot, inspected your editor or executed a test.

A worked example

Example result — example answers, not a real plan

Generated tests miss important cases · Python/FastAPI · VS Code

Tests that pass tell you the code ran, not that it is right. The useful question is whether each assertion could ever fail — and the fastest way to answer it is to make the implementation wrong on purpose.

Do these three, in order

  1. Break the code on purpose and watch the suite

    Invert a comparison, drop a guard clause, return a constant. Run the tests. Put it back.

    Why first: It is the only cheap experiment that distinguishes a test suite from a coverage number.

    Evidence: Supports weak tests: the suite still passes. Weakens: the suite fails on the exact assertion you expected, and names the behaviour.

  2. Name the behaviour before asking for tests

    Write the requirement in one or two lines — valid inputs, boundaries, what happens on failure — and give that to the agent instead of the implementation.

    Why first: Documented first-party guidance is explicit that inferring every expectation from the implementation risks tests that preserve an existing bug.

    Evidence: Supports: you cannot state the requirement without reading the code. Weakens: the requirement already exists and the tests still miss cases.

  3. Ask for the cases before the code

    Have the agent propose the case list — valid examples, both boundaries, invalid input, failure paths — without editing files. Review the list, then ask for tests.

    Why first: A missing case is obvious in a list of ten lines and invisible in two hundred lines of generated test code.

    Evidence: Supports: the proposed list is missing a boundary you care about. Weakens: the list is complete and the generated code does not implement it.

Prompt to paste into Copilot

Do not edit any files yet.

I want tests for <function or module> in Python/FastAPI. Its intended behaviour is:
* <rule 1 — valid input and expected result>
* <rule 2 — boundary>
* <rule 3 — what happens on invalid input>

1. Propose a list of test cases from that behaviour: valid examples, both
   sides of each boundary, invalid input, and the failure paths. Do not read
   the expected values off the implementation.
2. Mark any case where the intended behaviour is unclear as a question for me
   rather than choosing an answer.
3. Compare your list with the existing tests and say which cases are missing.

When I approve the list, add the tests using `tests/test_<module>.py`, pytest, existing fixtures (`pytest -q`) — reuse the existing
helpers, keep expected values explicit rather than computing them with the
function under test, and do not change implementation code, add dependencies
or refactor unrelated tests.

Check afterwards

  • Each assertion checks a named behaviour, not that execution finished.
  • Expected values are written out, not computed by calling the function under test.
  • Both sides of every boundary appear (at the limit and just outside it).
  • Invalid input and failure paths are covered, not only the happy path.
  • Mocks stand in for boundaries — network, clock, disk — not for the thing under test.
  • Implementation files are unchanged in the diff.
  • A deliberate break in the implementation makes ``tests/test_<module>.py`, pytest, existing fixtures (`pytest -q`)` fail.

Copilot for Python — getting pytest to disagree with the implementation

The testing section of the Python lesson: writing tests that can fail, and the Python habits generated code misses.

The interactive version needs JavaScript. Without it, the four problems it covers are: Copilot seems to ignore my instructions; Suggestions do not follow my project conventions; Generated tests miss important cases; Agent tasks make changes I did not intend — and the checks for each are in the articles and lessons linked below.

What this is, and what it is not

Four answers in, a plan out. It is a decision tree over reviewed content, not a model call: the same answers always produce the same plan, and the plan is written before you arrive rather than generated for you.

It has not read your repository, run Copilot, inspected your editor or executed a test — it cannot, and it says so wherever it presents a result. Everything it suggests is a check you make, with the observation that would support or weaken each one stated next to it.

The product behaviour behind each workflow comes from GitHub's and VS Code's own documentation, cited with the date it was read. Where a claim would need a per-client check this tool does not have, it says so instead of generalising — the IDE Compatibility Explorer is where per-editor support is tracked.

The four problems

  • Copilot seems to ignore my instructions. I wrote an instruction file and the output has not changed.
  • Suggestions do not follow my project conventions. The code is plausible, but it is not how this project does things.
  • Generated tests miss important cases. The tests pass, and I do not believe they would fail if the code were wrong.
  • Agent tasks make changes I did not intend. It went further than I asked, and I found out afterwards.

Related reading: diagnosing an ignored instruction file, scoped instructions in a monorepo, the Project Setup Kit, and the Academy. The maintained instruction-file library is The Copilot Stack Pro — a separate product from the GitHub Copilot subscription GitHub sells, and not required for anything here.