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

[Terminal Chat] The LLM receives confusing information about shell #18142

Open
vbrozik opened this issue Nov 3, 2024 · 4 comments
Open

[Terminal Chat] The LLM receives confusing information about shell #18142

vbrozik opened this issue Nov 3, 2024 · 4 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Discussion Something that requires a team discussion before we can proceed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@vbrozik
Copy link

vbrozik commented Nov 3, 2024

Windows Terminal version

1.23.3061.0

Windows build number

10.0.22631.0

Other Software

  • Ubuntu 22.04.5 LTS - installed as the default Ubuntu distribution in WLS2, then gradually updated
  • GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
  • GitHub Copilot

Steps to reproduce

  1. Use the default Ubuntu distribution in WSL.
  2. Open a terminal for it.
  3. Start a Terminal Chat.
  4. After few interactions it could mention that it has information that I am using a shell named ubuntu.exe.
  5. It seems that a sequence of these two user messages lead to responses like below: Hello, Please explain the error.

Image

Expected Behavior

The chatbot should not behave is if it received wrong information about the shell being used. It should either have information that I am using Ubuntu distribution of Linux (and maybe version) or that I am using Bash shell in Ubuntu Linux.

It should probably be allowed to modify parts of the initial prompt including information about the shell and operating system. This setting should be per profile.

Actual Behavior

The Terminal Chat probably receives confusing information about the shell in the terminal window in its preconfigured initial prompt.

When I am using the default Ubuntu WSL distribution with the default bash shell the GitHub Copilot responds as if it received information that I am using shell named ubuntu.exe:

Image

With Ubuntu 24.04 GitHub Copilot is confused even more:

Image

@vbrozik vbrozik added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 3, 2024
@zcobol
Copy link

zcobol commented Nov 4, 2024

@vbrozik LLM hallucination 😀

@vbrozik
Copy link
Author

vbrozik commented Nov 4, 2024

@zcobol we can see the hallucination in the second case: ubuntu2404.exe vs "Ubuntu 20.04"

...but I think we can be almost sure that the LLM receives information about the command used to start the WSL2 session like ubuntu.exe or ubuntu2404.exe and it is being wrongly presented to it as a shell running inside the terminal.

@DHowett
Copy link
Member

DHowett commented Nov 4, 2024

This is one of the annoying limitations we've run into - Terminal actually cannot know what is running "behind" the single executable that it started (in this case, ubuntu.exe or ubuntu2404.exe). There's no interface by which this data is communicated, so it makes a "best guess" and inserts the name of the root process of the tab.

It's not ideal.

@vbrozik
Copy link
Author

vbrozik commented Nov 6, 2024

Yes, I expected that Terminal lacking the information was the cause. I think that presenting ubuntu.exe to LLMs as a shell could cause bad experience for the users. I really do not know what is optimal to present to LLMs but I would certainly consider one or more of following solutions:

  • Present the command like ubuntu.exe as a command used to start the environment inside the Terminal, not as a shell.
  • Alternatively do not present the command at all to the LLM.
  • Create a configuration of initial prompt for the LLMs a part of the profile configuration. One of the parameters would be the default shell used with the profile. It will be the place to specify bash, POSIX shell, PowerShell etc.
  • When a profile is created the initial value of the default shell could be automatically inferred. Examples: ubuntu.exe -> bash or bash in Ubuntu Linux; powershell.exe -> PowerShell
  • Later there could be some kind of integration of the Terminal with shells. It would be really good to cooperate with the VS Code terminal team. For example the shell could communicate about itself to the Terminal using control sequences. This way the Terminal Chat could work correctly even if you start a new shell on a different machine for example through SSH.

@carlos-zamora carlos-zamora added the Needs-Discussion Something that requires a team discussion before we can proceed label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Discussion Something that requires a team discussion before we can proceed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

4 participants