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

Agent mode disabled when preview features are disabled #7550

Closed
klauszhang opened this issue Apr 1, 2025 · 14 comments
Closed

Agent mode disabled when preview features are disabled #7550

klauszhang opened this issue Apr 1, 2025 · 14 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release chat verified Verification succeeded

Comments

@klauszhang
Copy link

klauszhang commented Apr 1, 2025

Note from @roblourens - if you're seeing this, it likely means that the agent "preview" feature needs to be enabled by your org admin. Agent mode should no longer be behind this check, we are fixing.


Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.99.0-insider (Universal)
  • OS Version: Darwin arm64 24.3.0

Steps to Reproduce:
Setup Copilot by following login and other steps

  1. Open Github Copilot chat window
  2. Switch chat to agent mode
  3. Type in any words and press enter

Expect to see the agent mode start to work, actually nothing happens.

After open developer tools, I saw this error:

Error while handling chat request: Already handling this request: Error: Already handling this request

Image

I have tried to uninstall VSCode Insider and clear cache etc, didn't fix the issue.

more info from stack trace

  ERR Error while handling chat request: Already handling this request: Error: Already handling this request
    at $P.u (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1999:1477)
    at $P.s (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1999:1318)
    at $P.r (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1999:1121)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1999:948
    at Iwt.invokeFunction (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1884:673)
    at $P.invoke (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1999:857)
    at Z4e.invokeAgent (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:637:16414)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1965:36568
@roblourens
Copy link
Member

That implies that you weren't able to log into Copilot, or the extension couldn't start up for some other reason, can you share the logs from the Copilot Chat output channel? Were you prompted to log in at some point?

@roblourens roblourens added the info-needed Issue requires more information from poster label Apr 2, 2025
@TonyBrownDev
Copy link

TonyBrownDev commented Apr 2, 2025

I am running into this right now as well. I have already logged in and am able to confirm Ask and Edit actions work perfectly, it is only the agent workflow that is failing for me.

I do have the exact same error as reported by OP.

EDIT
I wanted to backfill the post with some more information. I've tested a bunch of different things and cannot seem to get it to work. Some of the attempts I have made are:

  1. Updated my settings.json within VS Code Insiders to have these values:
    "chat.agent.maxRequests": 25,
    "github.copilot.chat.codesearch.enabled": true,
    "github.copilot.chat.agent.thinkingTool": true,
    "github.copilot.advanced": {
        "agentChat": {
            "enable": true,
            "enableChatCompletions": true,
            "enableChatCompletionsV2": true,
            "enableChatCompletionsV3": true,
            "enableChatCompletionsV4": true,
            "enableChatCompletionsV5": true
        },
        "enableExperimentalFeatures": true,
        "enableExperimentalChat": true,
        "enableExperimentalChatCompletions": true,
        "enableExperimentalChatCompletionsV2": true,
        "enableExperimentalChatCompletionsV3": true,
        "enableExperimentalChatCompletionsV4": true,
        "enableExperimentalChatCompletionsV5": true
    },

Just to force agent chat.

  1. I have confirmed my account is active, paid, and has agent support enabled.
  2. I have forced clearing cache, restarted VS Code, and my computer itself
  3. Signed out of my Github accounts within the workspace and re-authenticate
  4. Tested all functionality again after performing each step

Image

@roblourens
Copy link
Member

roblourens commented Apr 2, 2025

The setting that matters is "chat.agent.enabled": true, that should already be enabled by default on Insiders.

This is a really interesting detail

am able to confirm Ask and Edit actions work perfectly, it is only the agent workflow that is failing for me.

Can you share the logs from the Copilot Chat output channel? Or any errors in the Window output channel?

@TonyBrownDev
Copy link

Thanks so much for the reply @roblourens. I will do my best to fill in where I can.

The setting mentioned, "chat.agent.enabled": true is correctly set within my USER settings.json along with a few others. Here's the short list of those, including the list I shared before since the code is nearby:

"chat.agent.enabled": true,
"chat.agent.maxRequests": 25,
"github.copilot.chat.agent.runTasks": true,
"github.copilot.chat.codesearch.enabled": true,
"github.copilot.chat.agent.thinkingTool": true,
"github.copilot.editor.enableAutoCompletions": true,
"github.copilot.advanced": {
    "agentChat": {
        "enable": true,
        "enableChatCompletions": true,
        "enableChatCompletionsV2": true,
        "enableChatCompletionsV3": true,
        "enableChatCompletionsV4": true,
        "enableChatCompletionsV5": true
    },
    "enableExperimentalFeatures": true,
    "enableExperimentalChat": true,
    "enableExperimentalChatCompletions": true,
    "enableExperimentalChatCompletionsV2": true,
    "enableExperimentalChatCompletionsV3": true,
    "enableExperimentalChatCompletionsV4": true,
    "enableExperimentalChatCompletionsV5": true
},

Regarding the logs from the Copilot Chat or Windows output channel, here's what I have. I have simply removed my computer name.

This is the Window log:

2025-04-02 15:30:48.983 [error] [Window] Error while handling chat request: Already handling this request: Error: Already handling this request
    at $P.u (vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1999:1477)
    at $P.s (vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1999:1318)
    at $P.r (vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1999:1121)
    at vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1999:948
    at Iwt.invokeFunction (vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1884:673)
    at $P.invoke (vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1999:857)
    at Z4e.invokeAgent (vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:637:16414)
    at vscode-file://vscode-app/C:/Users/[REDACTED]/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.desktop.main.js:1965:36771

BUUUUT I think I ultimately found my issue after you led me into the Copilot Chat output.

When I look at the Copilot Chat output, there was a warning that support for the Agent was disabled by the organization and provided me a link to https://docs.github.com/en/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-policies-for-copilot-in-your-organization#enabling-copilot-features-in-your-organization. After reviewing this, I was able to adjust the organization to allow for the agent. Once I saved that and reloaded my IDE, the Agent seems to work successfully.

We had to enable "Editor preview features" within https://github.com/settings/copilot for this to work.

I know you are all tackling so much, but it would be really nice to throw that specific error to the chat panel instead of failing without an error. Long term goals :)

Thanks so much for the help!

@bpasero
Copy link
Member

bpasero commented Apr 3, 2025

With microsoft/vscode#245415, if we detect that end up in such a situation, we show an error:

Image

@roblourens but I wonder how I can be more specific here. If I understand correctly:

  • we do have a extension provided chat agent but only for ask and edits
  • the user is picking a mode that is disabled by ORG policy (how can a user pick agent in this case though?)
  • the core/setup agent tries to forward to the agent
  • there is no extension provided one for the mode so we end up back in the core/setup one
  • 🐛 endless recursion and/or error

I think what I should probably do is to ensure that we have an extension provided agent with the mode we want to trigger before attempting to do so, but I wonder what error message I should show to the user.

In the end my feeling is that the UI should NOT allow a mode to be picked that is disabled remotely, is that possible?

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Apr 3, 2025
@bpasero bpasero added this to the April 2025 milestone Apr 3, 2025
@bpasero bpasero added the chat label Apr 3, 2025
@klauszhang
Copy link
Author

@roblourens @bpasero thank you for look into this issue. Here's the log I see in Github Copilot chat

2025-04-03 13:36:36.487 [info] Using the Electron fetcher.
2025-04-03 13:36:36.487 [info] Initializing Git extension service.
2025-04-03 13:36:36.511 [info] Logged in as klauszhang
2025-04-03 13:36:36.538 [info] Successfully activated the vscode.git extension.
2025-04-03 13:36:36.538 [info] Enablement state of the vscode.git extension: true.
2025-04-03 13:36:36.538 [info] Successfully registered Git commit message provider.
2025-04-03 13:36:37.426 [info] Got Copilot token for klauszhang
2025-04-03 13:36:37.637 [info] copilot token chat_enabled: true, sku: copilot_for_business_seat
2025-04-03 13:36:37.637 [info] GitHub.vscode-pull-request-github extension is not yet activated.
2025-04-03 13:36:37.647 [info] Registering default platform agent...
2025-04-03 13:36:37.660 [warning] Copilot preview features, including agent mode, are disabled by organizational policy. Learn more: https://aka.ms/github-copilot-org-enable-features
2025-04-03 13:36:38.002 [info] Fetched content exclusion rules in 354ms
2025-04-03 13:36:38.864 [info] Fetched model metadata in 1248ms 22097db7-5de3-4013-b7dd-3f59d213854b
2025-04-03 13:36:38.865 [info] activationBlocker from 'languageModelAccess' took for 1445ms
2025-04-03 14:06:39.286 [info] Logged in as klauszhang
2025-04-03 14:06:40.151 [info] Got Copilot token for klauszhang
2025-04-03 14:06:40.157 [info] copilot token chat_enabled: true, sku: copilot_for_business_seat
2025-04-03 14:06:40.161 [warning] Copilot preview features, including agent mode, are disabled by organizational policy. Learn more: https://aka.ms/github-copilot-org-enable-features

Maybe this one source of evil?

2025-04-03 14:06:40.161 [warning] Copilot preview features, including agent mode, are disabled by organizational policy. Learn more: https://aka.ms/github-copilot-org-enable-features

@bpasero
Copy link
Member

bpasero commented Apr 3, 2025

Ok, with microsoft/vscode#245442 I am awaiting not just any chat agent, but the one for the current ChatMode.

I still think the fix we need here is to disable agent mode (or any of the modes) when disabled by org policy.

@klauszhang
Copy link
Author

Update on this one: admin enabled copilot preview feature and now it is working as expected.

@roblourens roblourens removed this from the April 2025 milestone Apr 3, 2025
@roblourens roblourens added the candidate Issue identified as probable candidate for fixing in the next release label Apr 3, 2025
@roblourens
Copy link
Member

Agent mode is partially behind a "preview feature" check which should no longer be there. Sorry for the confusion. @bpasero hope it's ok that I take this issue over for the candidate.

@yeomanse
Copy link

yeomanse commented Apr 5, 2025

@roblourens It was the intention for agent to be no longer behind a preview check with the 1.99 release right? When can we expect to be able to use agent with out enabling our entire org for preview features?

@roblourens
Copy link
Member

Yes- we will fix this in a release next week- likely Wednesday.

@roblourens roblourens changed the title (Insider) Error while handling chat request: Already handling this request Error while handling chat request: Already handling this request Apr 6, 2025
@roblourens roblourens changed the title Error while handling chat request: Already handling this request Agent mode disabled when preview features are disabled Apr 7, 2025
@roblourens roblourens added the verified Verification succeeded label Apr 7, 2025
@roblourens
Copy link
Member

Fixed in 0.26.2

@aeschli aeschli transferred this issue from microsoft/vscode Apr 9, 2025
@aeschli aeschli added this to the March 2025 Copilot Recovery 2 milestone Apr 9, 2025
@aeschli
Copy link

aeschli commented Apr 9, 2025

@irieasha
Copy link

irieasha commented Apr 9, 2025

@roblourens one org owner has reported that the problem still exists for some users. I've refreshed the Copilot cache for the organization and the users have logged out of their GitHub account and VS Code completely and logged back in. They are still unable to use Agent Mode. Could you let me know if this needs a separate issue?

Enterprise (EMU): uhg
Example user where problem persists: rdickel_uhg
User has Copilot seats under two organizations: uhg-internal & uhc-consumer

They also provided the below information about their IDE:

Version: 1.99.1
Commit: 7c6fdfb0b8f2f675eb0b47f3d95eeca78962565b
Date: 2025-04-04T15:58:59.624Z
Electron: 34.3.2
ElectronBuildId: 11161073
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.4.0****

Update: I've asked them to enable it manually so this may not be a problem. Sorry for the noise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release chat verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants