-
Notifications
You must be signed in to change notification settings - Fork 27
Use primary agent for the remote authority when opening a workspace #552
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
base: main
Are you sure you want to change the base?
Conversation
I think it is reasonable to open the first agent when you click on the workspace. I could see an argument for making it pop open the agent select dialog, but if a user wants a different agent they could just click the right one directly on the sidebar instead. But, idk if users feel differently. We could always change it if we get feedback, this is already an improvement IMO. That said, I think we should make an additional fix, in |
Also forgot to say, thank you for the contribution! |
Happy to contribute to this project :)!
This is the current behavior if a workspace is opened with no agent in the remote authority, and there are multiple agents in the workspace. Should I then get rid of this QuickPick? Or offer it when trying to open the workspace and there are multiple agents?
The issue there is that |
True, but it happens after we open with that remote authority, which can cause the issue in #121. Ideally we do it before, so we are guaranteed one stable remote authority per agent.
I think we should keep it in case someone uses the open command from the command palette. When going that route, I think it makes sense to show the agent picker still.
Exactly my thinking, we refactor this function just a bit so we always call |
It is now done when calling
Actually for line 410 in |
I was thinking the same thing, it would be nice to remove it but I guess we need it for existing connections from the recents menu which might lack the agent. I think we do not need it for the manual input case though, because that would trigger the URI handler which calls Possibly we could rewrite these entries to add the agent, then we could delete that code, but not sure how hard that would be. |
@@ -597,12 +617,6 @@ export class Commands { | |||
} | |||
folderPath = agent.expanded_directory; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would override any folder passed via query param, so I think this will have to be:
folderPath = agent.expanded_directory; | |
if (!folderPath) { | |
folderPath = agent.expanded_directory; | |
} |
openRecent = args[4] as boolean | undefined; | ||
} | ||
|
||
if (workspaceAgent === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe we want if (!workspaceAgent)
in case someone has agent=
in the URI (so a blank string).
I just realized you were talking about the quick pick in So:
|
#121
This change updates the behavior when opening a workspace from the sidebar: the first agent is now opened automatically using the same remote authority URI as when opening the agent directly.
If a workspace has multiple agents, we always open the first one, skipping the agent selection QuickPick when the folder is opened. I implemented it this way since we're already opening the
folderPath
of the first agent by default.If this behavior should only apply when there's a single agent, it's easy to adjust. But in that case, should we also avoid passing the
folderPath
when multiple agents are present?