Skip to content

Add blog post: The Coding Harness Behind GitHub Copilot in VS Code#9740

Draft
jukasper wants to merge 6 commits into
mainfrom
blog/agent-harness-github-copilot-vscode
Draft

Add blog post: The Coding Harness Behind GitHub Copilot in VS Code#9740
jukasper wants to merge 6 commits into
mainfrom
blog/agent-harness-github-copilot-vscode

Conversation

@jukasper
Copy link
Copy Markdown
Member

@jukasper jukasper commented May 6, 2026

This PR adds a new blog post explaining the coding harness architecture behind GitHub Copilot's agent mode in VS Code.

The post covers:

  • What a coding harness is and why it matters
  • The model-harness interaction loop
  • How the harness provides tools and context to the model
  • Evaluation and benchmarking approach

Copy link
Copy Markdown
Collaborator

@ntrogh ntrogh left a comment

Choose a reason for hiding this comment

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

@jukasper Great post - very well explained and good level of depth! Also like the additional of diagrams.

I left some feedback, but nothing major.

Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
@jukasper
Copy link
Copy Markdown
Member Author

jukasper commented May 8, 2026

Thanks again for the feedback! I pushed an update that works through the review comments, including the intro intent statement, agent loop terminology, why the loop matters, the engine/car metaphor, updated diagrams, and improved image descriptions/accessibility text. Could you please take another look when you have a chance?

Copy link
Copy Markdown
Collaborator

@ntrogh ntrogh left a comment

Choose a reason for hiding this comment

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

@jukasper Left a few more small suggestions. Looks great already!

Comment thread .gitattributes
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No need to update this file

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.

Reverted — the blogs/2026/05/01/*.png LFS entry has been removed from .gitattributes.

Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md

![Simplified diagram of the VS Code agent loop: the user sends a chat message, the tool-calling loop builds a prompt, sends it to the model, executes requested tools, records results, checks loop-control conditions, and either continues or finalizes the chat result.](agent-loop.png)

A **turn** is the user-visible chat exchange: you send one message, and the agent eventually produces a response. During that turn, the agent loop may perform many **rounds**. A round is one pass through the loop: build the prompt, call the model, receive text and/or tool calls, execute any tools, record the results, and decide whether to continue. The full execution of all those rounds is the loop’s **run**. A single user turn might trigger many rounds as the model searches files, reads code, edits files, runs tests, reads the output, and iterates on failures.
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.

Give some interesting stats if you can. Like the p50, p90, p95 of rounds in a turn for Large/Small models.

Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md
Comment thread blogs/2026/05/01/agent-harnesses-github-copilot-vscode.md Outdated
@isidorn
Copy link
Copy Markdown
Contributor

isidorn commented May 13, 2026

Also consider mentioning all the automatiation we have around our harness - for example I noticed that we have a flow where a dev can trigger a harness run for a specific model on a PR - to make sure the changes made are actually good for the harness. So I would mention more of things like that! How harness is the key part of the development lifecycle in our team.

cc @rwoll probably has good ideas of example we could mention

Copy link
Copy Markdown
Collaborator

@ntrogh ntrogh left a comment

Choose a reason for hiding this comment

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

@jukasper A few final comments


The tool-calling loop is bounded by loop-control checks. We enforce a tool-call limit, check for cancellation between rounds, and run stop hooks. Stop hooks are extension points that can inspect the agent state and either allow it to finish or push it to keep working. Within the loop, the prompt is rebuilt on every iteration. That means the model always sees the latest state of the workspace: if it edited a file three rounds ago, the current prompt reflects that edit. The harness also manages conversation summarization. When the accumulated history grows too large, it compresses earlier rounds into a summary so the model can keep working without hitting the context window ceiling.

> **Note:**
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
> **Note:**
> [!NOTE]

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.

Updated to > [!NOTE].

The tool-calling loop is bounded by loop-control checks. We enforce a tool-call limit, check for cancellation between rounds, and run stop hooks. Stop hooks are extension points that can inspect the agent state and either allow it to finish or push it to keep working. Within the loop, the prompt is rebuilt on every iteration. That means the model always sees the latest state of the workspace: if it edited a file three rounds ago, the current prompt reflects that edit. The harness also manages conversation summarization. When the accumulated history grows too large, it compresses earlier rounds into a summary so the model can keep working without hitting the context window ceiling.

> **Note:**
> Want to see the harness in action? You can [explore the VS Code source code](https://github.com/microsoft/vscode), use the Tools UI in Chat to review the tools available for a request, and open the [Chat Debug View](https://code.visualstudio.com/docs/copilot/chat/chat-debug-view) to inspect the prompts, tool calls, and results.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The Agent Debug Logs window is more interesting to view the harness in action. It also has a flowchart visualization (maybe include a screenshot of this in the blog?). https://code.visualstudio.com/docs/copilot/chat/chat-debug-view#_agent-debug-log-panel

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.

Updated the note to link directly to the Agent Debug Log panel and mention the flowchart visualization.

@ntrogh
Copy link
Copy Markdown
Collaborator

ntrogh commented May 14, 2026

@copilot Can you review the blog post for typos and incorrect grammar?

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

@copilot Can you review the blog post for typos and incorrect grammar?

Reviewed the full post. Fixed two grammar issues: a missing comma after "Visual Studio Code" in the intro paragraph, and "how can we verify" → "how we can verify" (indirect question form). The rest of the post looks clean.

Copilot finished work on behalf of ntrogh May 14, 2026 08:30
Copilot AI requested a review from ntrogh May 14, 2026 08:30
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.

4 participants