Christopher Harrison and John Peek, enterprise advocates at GitHub, are conducting a hands-on lab focused on developer experience with GitHub Copilot.
Participants are instructed to send their GitHub handle via email to gain access to the lab.
Due to potential Wi-Fi challenges, participants will have a couple of days to complete the lab on their own time if they cannot finish during the session.
Code Completions: The original mode, where Copilot suggests the next line, function, or class, aiding developers "in the zone."
Chat: Originally single-shot questions and answers, like generating a single file.
Edits: Allows Copilot to edit across multiple files, addressing the need for multi-file updates (e.g., HTML, JavaScript, CSS for a webpage).
Agent Mode (IDE-based): Enables Copilot within the IDE to navigate projects, determine tasks, build code iteratively, run external tasks (like unit tests), and self-heal errors.
Coding Agent (github.com-based): A newer mode where a GitHub issue can be assigned to the coding agent, which then works in the background to figure out what needs to be done, runs scripts, self-heals, and eventually creates a pull request for review.
The coding agent's goal is to act as an AI pair programmer, taking a GitHub issue and beginning work on it.
Providing detailed context in the issue description (requirements, potential workflows) is crucial for the coding agent.
The agent works within a specific environment defined by a "copilot setup steps" workflow, which installs necessary services and packages.
Security is a major focus:
By default, the coding agent is firewalled and does not have internet access, including for installing frameworks or libraries, unless explicitly opened.
It runs in an ephemeral GitHub Actions space, limiting its access to other resources.
It does not have write access to the main repository; it can only modify the branch it creates.
Pull requests created by the agent are in draft form and require manual approval to run workflows (like security checks, unit tests).
By design, the person who assigns an issue to the coding agent is not allowed to review its work; a different person must perform the review.
Copilot can iterate on its work: adding a comment to an issue (e.g., "also add an endpoint to search for games by name") will trigger a new session where Copilot builds upon its previous work.
The coding agent currently does not work with self-hosted runners.
Copilot cannot be leveraged to perform actions on another company's codebase via a GitHub application; it needs to operate on a repository that the user owns.
If Copilot produces incorrect or unexpected output, several approaches can be taken:
Add a clarifying comment to the issue to provide more context or specific instructions.
If the output is completely wrong, unassign Copilot, modify the issue, and then reassign Copilot to start from scratch.
Analyze why it got it wrong, often due to insufficient context about the request or the working environment.
copilot-instructions.mmd files provide additional context to coding agent and chat requests, outlining app introduction, code standards, required pre-commit checks, global language guidance, and repository structure.
Model Context Protocol (MCP) servers allow Copilot to access external data and perform operations on the user's behalf, extending beyond its training set.
AI does not change the fundamental DevOps flow; manual code reviews, linters, security scans, and unit tests are still essential safeguards for code quality and security.
While Copilot may work on specific files, there's no guarantee it will only modify that file in agent mode; for precise, single-file changes, edit mode or ask mode in the IDE might be more suitable.
Code generated by Copilot is probabilistic, meaning it might not always be exactly as desired, but the generated branch can be manually edited or further refined by Copilot with new comments.
MCP servers can access remote servers and act on behalf of the user, with connection credentials (e.g., tokens) allowing for expiration settings.
MCP servers do not automatically act; the user must indicate intent, and a prompt to approve workflow runs appears. Vetting MCP servers is crucial.
copilot-instructions.mmd files can reference other instructions files and apply to specific folders or file patterns (e.g., .jsx, .tsx, .svelte), providing consistent guidance for code generation.
Instructions files should be treated as artifacts of the repository, updated as needed to maintain productivity and ensure generated code aligns with desired patterns.
Consistency in instructions and context provided to Copilot is vital to avoid "mixed messages" and ensure predictable behavior.
MCP server configurations can be set at the organization or repository level, with variables for centralization, but users still need to set up their own credentials.
When using MCP servers with agent mode, it's beneficial to specify which MCP server to use in the instructions file if a specific scenario requires it.