Skip to content

Trailing new lines in presets are different between AI model webchat providers #473

@littleboot

Description

@littleboot

Presets trailing new lines in prompt prefix are incorrect and depending on the AI provider (same behavior in firefox and chrome)

Image

For example my gemini prefix has a single trailing newline char \n but two are inserted after the system prompt,

<system>You're a helpful coding assistant, follow these rules when answering:`talk like a pirate`</system>

 first line

NOTE there also is an additional space before the chat content first line

Example gpt chat window:

<system>You're a helpful coding assistant, follow these rules when answering:`talk like a pirate`</system>
 first line

mostly correct, but an additonal space before the chat content (probably intentional)

Example qwen response (identical to gpt)

Example Claude:

<system>You're a helpful coding assistant, follow these rules when answering:`talk like a pirate`</system> first line

ignores the new line all together.

Why I want this fixe.

I want to be able to read back my chats in the webchat UI, for this I want to have a newline between the prompt and the chat context.
Maybe replace the default space that is used to separate the prompt prefix from the chat content with a newline char \n still a single character and makes reading back the chat easier.

Settings.json:

    "codeWebChat.chatPresetsForNoContext": [
        {
            "name": "Gemini pro",
            "chatbot": "Gemini",
            "promptPrefix": "<system>You're a helpful coding assistant, follow these rules when answering:`talk like a pirate`</system>\n",
            "model": "pro"
        },
        {
            "name": "ChatGPT thinking",
            "chatbot": "ChatGPT",
            "promptPrefix": "<system>You're a helpful coding assistant, follow these rules when answering:`talk like a pirate`</system>\n",
            "options": [
                "thinking"
            ]
        },
        {
            "name": "Qwen",
            "chatbot": "Qwen",
            "promptPrefix": "<system>You're a helpful coding assistant, follow these rules when answering:`talk like a pirate`</system>\n",
            "options": [
                "thinking"
            ]
        },
        {
            "name": "Claude",
            "chatbot": "Claude",
            "promptPrefix": "<system>You're a helpful coding assistant, follow these rules when answering:`talk like a pirate`</system>\n",
            "model": "sonnet-4-5"
        }
    ],

I'm using a windows 11 PC with vscodium

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions