Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 19 of 30
❮Prev Next❯

The Copilot Code Suggestion Lifecycle and LLM Limits

Module 3: Data & Architecture ⏱ 10 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    A Copilot inline suggestion has a lifecycle: you pause typing, the IDE extension gathers context and checks content exclusions, builds a prompt that fits the context window, and sends it over HTTPS to the Copilot proxy (auth and pre-filters). The LLM predicts tokens, post-processing filters the reply, and it appears as grey ghost text. You Tab to accept, Esc to dismiss, Alt+] / Alt+[ to cycle alternatives, Ctrl+→ to accept word by word, and engagement data records what you chose. LLM limits still apply: a knowledge cut-off, hallucinated APIs or packages, insecure or outdated code, bias, non-deterministic output, a limited context window, weaker results for rare languages, and no real understanding or execution of your code.

    Simulate it » No Azure account needed

    Exam objective: 3.2.1 Visualize code suggestion lifecycle. 3.2.2 Describe limitations of LLMs and Copilot. (Skills measured as of August 7, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    VS Code & GitHub: The life of a suggestion Cycle alternatives, accept word by word and meet the limits.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading…

    You pause, the IDE sends context, and a suggestion comes back as ghost text. There may be several: <strong>Alt+]</strong> and <strong>Alt+[</strong> cycle them.

    👆 Click the glowing item on screen to continue

    Read the steps as text
    1. You pause, the IDE sends context, and a suggestion comes back as ghost text. There may be several: Alt+] and Alt+[ cycle them.
    2. Accept all with Tab, a word at a time with Ctrl+→, or open the Completions panel (Ctrl+Enter) to compare several.
    3. Then you accept, edit or reject it. Remember the limits: a knowledge cut-off, a finite context window, non-deterministic output, weaker results for rare languages, and no real understanding.

    🧪 Simulation for learning. Screens are simplified versions of Visual Studio Code and github.com with GitHub Copilot; names, files and suggestions are examples. Not affiliated with GitHub or Microsoft, and nothing here touches your real account.

    😟 THE PROBLEM

    A suggestion was confidently wrong about a library released last month.

    😊 THE SOLUTION

    Know the life of a suggestion and the limits of the model behind it.

    • Knowledge cut-off✓ Check new APIs in the docs
    • Different answer each time✓ Cycle alternatives, compare
    • Limited context✓ Give it the right files
    🛠️ Solved with: Suggestion lifecycle

    Start with a question

    Copilot finishes your line almost before you've stopped typing. How many checks did that suggestion pass, and which mistakes could still be inside it?

    Think of ordering food on an app. You tap, the restaurant gets your order, the kitchen cooks, someone packs and seals it, and a rider drops it at your door. Plenty of checks happen. You still open the box before you eat.

    A Copilot suggestion has the same kind of journey. It’s quick because every step is small, but there are several of them, and the model at the centre has real limits. Knowing the lifecycle helps you answer exam questions, and it helps you spot when a suggestion is likely to be wrong.

    Explain it like I’m 10

    Visual: a suggestion’s life in motion

    Watch one suggestion travel from a pause in src/discount.js to ghost text, then meet the limits it still carries.

    ▶ Explainer video See it in motion 8 steps · 1 min 45 sec

    An animation of the life of one GitHub Copilot inline suggestion in VS Code. A developer pauses inside applyDiscount in src/discount.js. The extension gathers context (code before and after the cursor, the file name and language, an open tab), skips excluded files and trims the prompt to fit the context window. The prompt goes over HTTPS to the Copilot proxy, which authenticates it and runs pre-filters. The model predicts tokens, post-processing checks quality, insecure patterns, offensive content and public code matches, and the suggestion appears as ghost text. The developer accepts it with Tab, engagement data is recorded, and the video ends with the limits of large language models.
    Read the video script
    1. You type, then pauseYou're inside applyDiscount and you stop typing for a moment. That pause is the trigger. The Copilot extension in VS Code starts a request for a suggestion.
    2. The extension gathers contextNext, it gathers context. The code above the cursor, the code below it, the file name and language, and related bits from tabs you have open, like cart dot js.
    3. Exclusions, then a prompt that fitsFiles your admin has excluded are left out. Then the extension trims the rest, because the model can only read so much at once. What's left is the prompt.
    4. Over HTTPS to the Copilot proxyThe prompt travels encrypted to the Copilot proxy. It checks you're allowed to use Copilot, then filters out harmful text and prompt injection attempts before the model sees anything.
    5. The model predicts tokensThe model predicts the most likely next tokens, one after another. It's matching patterns. It never runs your code, so a confident answer can still be wrong.
    6. Post-processing checks the replyBefore you see it, the reply is checked again. Quality and common insecure patterns, offensive content, and, if your policy blocks public code matches, a check for that too.
    7. Grey ghost text appearsThe suggestion shows up as grey ghost text right where you paused. Tab takes it, Escape throws it away, and Alt plus the right bracket shows you another option.
    8. You decide, then remember the limitsYou press Tab and the code is yours to check. Copilot records that you accepted it, which feeds usage metrics. And keep the limits in mind: a knowledge cut-off, a small window, answers that change, and mistakes.

    The technical explanation

    The lifecycle, step by step

    StepWhat happensWhere
    1. TriggerYou pause while typing (or trigger a suggestion explicitly)Your editor
    2. Gather contextCode before and after the cursor, file name and language, related open tabsIDE extension
    3. ExclusionsFiles covered by a content exclusion are skippedIDE extension
    4. Build the promptContext is ranked and trimmed to fit the context windowIDE extension
    5. SendEncrypted over HTTPSNetwork
    6. ProxyAuthentication and pre-filters (offensive content, prompt injection)GitHub
    7. GenerateThe LLM predicts the most likely tokens, sometimes several candidatesModel
    8. Post-processQuality, insecure patterns, offensive content, public code matchGitHub
    9. DisplayGrey ghost text at your cursorYour editor
    10. DecideAccept, accept part, cycle, or dismiss; engagement data is recordedYou

    Your keys at step 10

    ActionWindows and LinuxmacOS
    Accept the whole suggestionTabTab
    DismissEscEsc
    Next / previous alternativeAlt+] / Alt+[Option+] / Option+[
    Accept the next wordCtrl+→Cmd+→
    Open the completions panelCtrl+EnterCtrl+Enter

    Next edit suggestions (NES) extend the idea: after you change something, Copilot predicts the next edit you’re likely to make, even a few lines away, and you jump to it and accept with Tab. The VS Code & GitHub tab shows cycling three alternatives and accepting word by word.

    Limits of LLMs and Copilot

    The model in step 7 is powerful and still a guesser. Know these limits by name:

    • Knowledge cut-off. Training data stops at a date, so newer library versions and APIs may be missing or wrong.
    • Hallucinations. It can invent functions, options or whole packages that don’t exist. Installing a made-up package name is a real supply-chain risk.
    • Insecure or outdated code. It learned from public code, including bad patterns.
    • Bias. Assumptions in training data can show up in names, examples and logic.
    • Non-deterministic output. The same prompt can give different results.
    • Limited context window. It only sees what fits in the prompt, not your whole system.
    • Rare languages and frameworks. Less training data means weaker suggestions.
    • No real understanding or execution. It doesn’t run, compile or test what it suggests.
    // Copilot suggested this in src/discount.js. Looks fine. Is it?
    const pct = CODES[code] ?? 0;
    return Math.round(total - (total * pct) / 100);   // rounding rule: does the business want this?

    The code is plausible, and only you know whether rounding belongs there. That’s the whole point: review it, run npm test, and keep it only if it matches the requirement.

    Architect level Why non-determinism isn't a bug

    A language model gives a probability for each possible next token. If it always picked the single most likely one, output would be repetitive and often worse. So it samples, which means two runs can differ. Your context also changes constantly as you type and switch tabs. That’s why the completions panel and Alt+] exist: you’re expected to look at options and choose. It’s also why you can’t treat “Copilot wrote it the same way last time” as evidence of correctness. Tests are the evidence.

    Real-world business scenario

    Wholesale distribution

    Northwind Traders (fictional)

    The problem
    A junior developer accepted a Copilot suggestion that imported a package which didn't exist on npm. The install failed, and a teammate nearly swapped in a similar-looking package from an unknown publisher before review caught it.
    What they used
    Team training on the suggestion lifecycle and LLM limits, a rule that every new dependency is checked on the registry, plus Dependabot and code scanning in CI.
    Why that choice
    Developers now know suggestions are predictions with a knowledge cut-off and can hallucinate, so they verify packages and APIs instead of trusting confident ghost text.
    The result
    New dependencies now go through a quick registry check in review, and no invented package has reached the main branch since.

    When to use it and when not to

    ✓ Use it when…

    • Accept boilerplate and patterns you recognise, then run the tests.
    • Cycle alternatives with Alt+] or the completions panel when the first idea is close but not right.
    • Accept word by word when only the start of a suggestion is useful.

    ✕ Think twice when…

    • Accepting calls to APIs or packages you haven't checked exist.
    • Trusting suggestions for brand-new library versions released after the model's cut-off.
    • Skipping review because the suggestion passed Copilot's filters.

    ↔ Alternatives to consider

    • Copilot Chat with #file context when you need an explanation, not just a completion.
    • Agent mode when you want Copilot to run the tests and iterate, still with your approval and review.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the GH-300 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    Which sequence correctly describes the lifecycle of a GitHub Copilot inline suggestion?

    Question 2

    Question 2 of 5

    A developer using Visual Studio Code on Windows sees an inline suggestion and wants to view the next alternative suggestion. Which key combination should the developer press?

    Question 3

    Question 3 of 5

    Copilot suggests a method from an older version of a library. The current version renamed that method last month. Which limitation of large language models best explains this?

    Question 4

    Question 4 of 5 · Select 3

    Which three statements describe limitations of GitHub Copilot and large language models? Each correct answer presents part of the solution.

    Question 5

    Question 5 of 5

    A developer wants to accept only the first word of a multi-line inline suggestion in Visual Studio Code on Windows. What should the developer press?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner Walk me through what happens between pausing and seeing ghost text.

    Model answer

    The extension notices the pause and gathers context: code around my cursor, the file name and language, and snippets from open tabs, skipping excluded files. It builds a prompt that fits the context window and sends it over HTTPS to the Copilot proxy, which authenticates and pre-filters it. The model predicts a completion, post-processing checks it, and it shows up as ghost text. Then I accept, cycle or dismiss it.

    Interviewer follows up

    What gets recorded after that?

    You

    Engagement data: whether I accepted or dismissed it, plus errors and timing. That powers the service and usage metrics.

    Intermediate How do you see a different suggestion without retyping?

    Model answer

    Alt+] for the next one and Alt+[ for the previous one, or Option on macOS. If I want to compare several at once, Ctrl+Enter opens the completions panel. Ctrl+Right Arrow accepts just the next word if only the start is right.

    Experienced developer Copilot suggested a call to a library method that doesn't exist. Why, and what do you do?

    Model answer

    That's a hallucination. The model predicts likely-looking code from patterns; it doesn't check the library. The method might be from an old version before its knowledge cut-off, or it just sounds right. I check the library's docs, run the code and tests, and give Copilot the real API in context, for example by opening the file that uses it.

    Scenario Two developers ask Copilot the same thing and get different code. One says Copilot is broken.

    Model answer

    It isn't. Model output is non-deterministic, so the same prompt can give different answers, and their context differs too: different open tabs, different nearby code. What matters is that each answer is reviewed and tested against the same requirements.

    Quick revision

    Key points

    • Lifecycle: pause → gather context → exclusions → prompt → HTTPS → proxy (auth, pre-filters) → LLM → post-processing → ghost text → accept or reject → engagement data.
    • Keys: Tab accept, Esc dismiss, Alt+] / Alt+[ cycle (Option on macOS), Ctrl+→ next word, Ctrl+Enter completions panel.
    • Next edit suggestions predict your next edit based on recent changes.
    • LLM limits: knowledge cut-off, hallucinations, insecure or outdated code, bias, non-determinism, limited context window, weaker for rare languages, no real understanding or execution.
    • Every accepted suggestion is a draft you review and test.

    Important terminology

    Ghost text
    The grey, italic inline suggestion Copilot shows at your cursor before you accept it.
    Completions panel
    A side panel (Ctrl+Enter) that lists several alternative suggestions so you can compare them.
    Next edit suggestions (NES)
    A Copilot feature that predicts the next edit you're likely to make, possibly elsewhere in the file, based on your recent changes.
    Knowledge cut-off
    The date the model's training data ends. Libraries and APIs released later may be missing or wrong.
    Hallucination
    Output that looks plausible but is false, such as a function, API or package that doesn't exist.
    Non-deterministic output
    The same prompt can produce different suggestions each time, because the model samples from probabilities.

    Common mistakes

    • Treating ghost text as verified because it looks confident.
    • Expecting identical output for the same prompt every time.
    • Assuming Copilot knows the newest version of a library.

    Exam tips

    • "See an alternative suggestion" = Alt+] (next) or Alt+[ (previous).
    • "Accept only part of a suggestion" = Ctrl+→ (next word).
    • "Suggested package doesn't exist" = hallucination; verify before installing.

    Five quick revision questions

    1. 1.Which key accepts a whole suggestion?Show

      Tab

    2. 2.Which shortcut opens the completions panel?Show

      Ctrl+Enter

    3. 3.Why can Copilot suggest outdated APIs?Show

      Its training data has a knowledge cut-off.

    4. 4.Does the model run your code before suggesting it?Show

      No.

    5. 5.What triggers an inline suggestion?Show

      Pausing while you type (or an explicit trigger).

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Prompt Structure and Context for Copilot

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.