Problem
When demoing GitHub Copilot Chat during a live presentation, responses are non-deterministic. The AI may give a different answer than expected, which breaks the flow of a carefully prepared demo.
Idea
Use Dev Proxy — a Microsoft open source API simulator — to intercept Copilot Chat requests and return predefined responses.
Copilot Chat communicates with api.individual.githubcopilot.com/chat/completions, which is an OpenAI-compatible endpoint. Dev Proxy can intercept and mock this using its MockResponsePlugin.
POC Goal
Validate the following flow works end-to-end:
- Dev Proxy starts in the background (via a Demo Time terminal action)
- Dev Proxy intercepts requests to the Copilot Chat completions endpoint
- A predefined mock response is returned instead of the real AI response
- The presenter types a question in Copilot Chat → the fake response appears
- Dev Proxy is stopped after the demo step
Suggested POC setup
devproxyrc.json
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.4.0/rc.schema.json",
"plugins": [
{
"name": "MockResponsePlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "mockedResponses"
}
],
"urlsToWatch": [
"https://api.individual.githubcopilot.com/chat/completions",
"https://api.githubcopilot.com/chat/completions"
],
"mockedResponses": {
"mocks": [
{
"request": { "method": "POST" },
"response": {
"statusCode": 200,
"body": {
"choices": [{
"message": {
"role": "assistant",
"content": "Here is a predefined demo response!"
},
"finish_reason": "stop"
}]
}
}
}
]
}
}
Demo Time wires this up via a terminal action:
demo.json (excerpt)
{
"action": "executeTerminalCommand",
"command": "devproxy --config-file .demo/copilot-mocks.json &"
}
References
Open questions
- Does Copilot Business block the Dev Proxy certificate? (Individual accounts should be fine)
- Should Demo Time bundle a
devproxy install check / install step?
- Should the mock config live inside
.demo/ per project?
Problem
When demoing GitHub Copilot Chat during a live presentation, responses are non-deterministic. The AI may give a different answer than expected, which breaks the flow of a carefully prepared demo.
Idea
Use Dev Proxy — a Microsoft open source API simulator — to intercept Copilot Chat requests and return predefined responses.
Copilot Chat communicates with
api.individual.githubcopilot.com/chat/completions, which is an OpenAI-compatible endpoint. Dev Proxy can intercept and mock this using itsMockResponsePlugin.POC Goal
Validate the following flow works end-to-end:
Suggested POC setup
Demo Time wires this up via a terminal action:
References
Open questions
devproxyinstall check / install step?.demo/per project?