Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Integration] [copilot-extension] Github agent's response more than 60 seconds will generate 'internal agent error' #2

Open
leungkimming1 opened this issue Nov 12, 2024 · 1 comment

Comments

@leungkimming1
Copy link

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:

  1. Follow https://github.com/copilot-extensions/blackbeard-extension to build and run the demo agent
  2. 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,
      }),
    }
  );
  1. Type below prompt:
@[your demo GitHub App name] show me examples of how to create and use C# array
  1. Notice the 'internal agent error' after a few lines of output

  2. 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

@leungkimming1 leungkimming1 changed the title [Integration] [copilot-extension] Github agent's respond more than 60 seconds will generate 'internal agent error' [Integration] [copilot-extension] Github agent's response more than 60 seconds will generate 'internal agent error' Nov 12, 2024
@Houndie
Copy link

Houndie commented Nov 21, 2024

Hi @leungkimming1 !

Thanks for the excellent and detailed report.

The timeout is intentional...we do set limits on how long an extension can take to respond. However, we're aware these limits are not well-documented and the error message is not informative. We've got an internal work item set up to improve this messaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants