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
Tracked by #15000
vbrozik opened this issue Nov 3, 2024 · 5 comments
Open
Tracked by #15000

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

vbrozik opened this issue Nov 3, 2024 · 5 comments
Assignees
Labels
Area-Chat All things LLM or "AI" Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

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
@lhecker lhecker removed the Needs-Discussion Something that requires a team discussion before we can proceed label Nov 18, 2024
@PankajBhojwani
Copy link
Contributor

Those are some solid suggestions, thank you! We actually do have a work item for allowing the user to modify/add to the system prompt that we send to the LLM, once that is implemented we can remove the 'default' addition that we do right now entirely and just use the user-provided one, which should fix this :)

@carlos-zamora carlos-zamora added this to the Terminal v1.23 milestone Nov 20, 2024
@carlos-zamora carlos-zamora added Product-Terminal The new Windows Terminal. Area-Chat All things LLM or "AI" and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Chat All things LLM or "AI" Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

6 participants