[Integration] [copilot-extension] Github agent's response more than 60 seconds will generate 'internal agent error' #2
Open
Description
Describe the integration issue
I am using VS Code GitHub CoPilot Chat. I have a GitHub agent that will produce long program source output (> 400 lines). If the response is over 60 seconds, I will receive a 'internal agent error' but the agent will continue to run until completion but no more output after the error.
Steps to reproduce the issue
Detailed steps to reproduce the integration issue:
- Follow https://github.com/copilot-extensions/blackbeard-extension to build and run the demo agent
- Amend the index.js to add a timeout delay as follows
// Simulate doing lots of retrieve and searching work....
await new Promise(resolve => setTimeout(resolve, 55500));
console.log("times up");
// Use Copilot's LLM to generate a response to the user's messages, with
// our extra system messages attached.
const copilotLLMResponse = await fetch(
"https://api.githubcopilot.com/chat/completions",
{
method: "POST",
headers: {
authorization: `Bearer ${tokenForUser}`,
"content-type": "application/json",
},
body: JSON.stringify({
messages,
stream: true,
}),
}
);
- Type below prompt:
@[your demo GitHub App name] show me examples of how to create and use C# array
-
Notice the 'internal agent error' after a few lines of output
-
Change the delay to 40000 (40 seconds) and everything is back to normal.
Affected tools/platforms
VS Code GitHub CoPilot Chat.
Screenshots or logs
GitHub CoPilot Chat log:
2024-11-12 23:35:19.926 [info] Logged in as leungkimming
2024-11-12 23:35:21.275 [info] Got Copilot token for leungkimming
2024-11-12 23:35:21.279 [info] copilot token chat_enabled: true, sku: monthly_subscriber
2024-11-12 23:45:19.452 [info] Fetched model metadata in 926ms 439f8b54-ea08-4227-a834-6cb93fed963e
2024-11-12 23:46:32.772 [error] Unexpected response with no choices or error for request id
2024-11-12 23:46:32.774 [info] message 0 returned. finish reason: [Iteration Done]
2024-11-12 23:46:32.775 [info] request done: requestId: [] model deployment ID: []
Additional context