Skip to content

Added profile, provider, and workspace preselection to chat templates - #1099

Merged
SommerEngineering merged 25 commits into
MindWorkAI:mainfrom
peerschuett:chat-templates-choose-profile-provider-workspace
Oct 22, 2026
Merged

SommerEngineering merged 25 commits into
MindWorkAI:mainfrom
peerschuett:chat-templates-choose-profile-provider-workspace

Conversation

@peerschuett

@peerschuett peerschuett commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Chat templates could already preselect tools and data sources. They couldn't choose the provider (and so the model), the profile, or where their chats are kept. So users had to switch these by hand for every chat, for example to pick a provider whose confidence level a mailbox data source needs. This PR lets a chat template preselect all three.

Changes

  • New optional template fields: ProviderId, ProfileId and WorkspaceName on ChatTemplate. They are preselections, not locks: users can still change provider and profile in the chat and move the chat to another workspace.
    • Provider: used only if it exists and meets the confidence level required for chats. Otherwise the chat starts with its usual provider.
    • Profile: the empty GUID starts the chat without a profile. A profile that's gone falls back to the user's default. The field is ignored when AllowProfileUsage is false.
    • Workspace: given by name, because workspace IDs differ on every computer. It applies only where the chat would otherwise be a disappearing chat. On the chat page the workspace is created with the first message, not when a template is picked. It's ignored while workspaces are off, and a chat launcher that names its own workspace keeps it.
  • Chat start (ChatComponent, DirectChatService): chats apply the template's selections. Switching to a template without them no longer carries over the previous template's provider or profile. Launchers drop their data sources while RAG is off.
  • Enterprise configuration: the three fields are parsed from configuration plugins, imported from snippets and included in Lua exports. Exports add a note that provider and profile IDs are local to the computer they came from.
  • Tests: template configuration parsing and export, snippet import, and how chats and launchers pick their start selections.
  • Minor: pdfium.dll added to .gitignore

Related proposal or issue

Internal issue

How did you test it?

  • Ran dotnet run verify
  • Ran the app locally, and tried out disabling workspaces, using direct chat launcher assistants, removing preselected profiles from chat templates, etc.

Required statements

  • Review: I have reviewed every change in this pull request and can explain it when asked.
  • License: I license my contribution in this pull request, including all commits I add to it later, under the MIT License, and I agree that it is distributed as part of MindWork AI Studio under the project license or under the MIT License.
  • Right to contribute: The contribution is my own work, or I have permission to submit it, including the consent of my employer or client where needed. To the best of my knowledge, it does not infringe the rights of others, and AI-generated parts do not reproduce third-party code under incompatible terms.
  • Changes by maintainers: I understand that the maintainers will change this pull request to fit the product, and that they may close it.

Credits (optional)

  • Credit me with my GitHub username only.
  • Do not credit me.

Peer Hogeterp and others added 10 commits October 21, 2026 13:44
Chat templates gain the optional fields ProfileId and ProviderId. Null
keeps saying nothing, so chats keep their usual profile and provider; the
empty GUID as ProfileId states that chats start without a profile.

Configuration plugins read both fields from CONFIG[CHAT_TEMPLATES], and
an entry which is no usable GUID is dropped with a warning. The export
writes them, with a note that the IDs stem from this machine, and the
snippet import names a provider or profile which does not exist here.

Nothing uses the fields yet; starting chats with them follows separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chat now starts with the profile and provider its chat template
preselects: the first chat of the page, every new chat, and a change of
the template before the first message. The provider of the template wins
over the setting for the provider of added chats. Either stays
changeable in the chat.

What cannot be used is left out, and the chat starts as if the template
said nothing: a profile or provider which is gone, a provider below the
confidence level of chats, and a profile of a template which forbids
profiles. SettingsManager decides this in one place for the chat and
for assistant chat launchers.

For launchers, the template wins over the profile and provider of the
launcher, the same rule as for tools and data sources, and the dropped
choice is logged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chat template dialog gains a switch and a selection for the profile
and one for the provider, in the style of the tools and data sources.
The profile offers "use no profile" as well and only appears while the
template allows profiles; the provider list holds the providers which
may be used for chats. A warning names a preselected profile or
provider which is gone or may not be used, for example in a template
from a configuration plugin.

The form of assistant chat launchers now says when the chosen chat
template brings a provider or profile of its own, which wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example configuration plugin shows a chat template which preselects
a provider and a profile, the Enterprise IT documentation explains what
each field means and how missing targets behave, and the README of the
assistant plugins states that a template wins over the launcher for
both. The changelog tells users and IT departments about the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chat templates gain the optional field WorkspaceName. It names the
workspace by name rather than by ID, because a workspace has an ID of its
own on every computer; like for assistant chat launchers, the workspace
is created when it does not exist yet.

Configuration plugins read the field from CONFIG["CHAT_TEMPLATES"], an
empty or non-text value is dropped with a warning, and the export and the
snippet import carry it. SettingsManager returns no workspace while
workspaces are switched off.

Nothing uses the field yet; starting chats in it follows separately.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A chat whose chat template names a workspace now starts in it, wherever
it would belong to no workspace otherwise: the first chat of the page,
a new disappearing chat, and a change of the template before the first
message. The workspace is created when it does not exist yet. Like every
new chat in a workspace, the chat reaches the disk only once there is
something to keep.

A workspace chosen on purpose wins: the one of the workspace list, the
open one for the button that starts a new chat in it, and the one an
assistant chat launcher names. A launcher that opens a disappearing chat
takes the workspace of its template instead.

A workspace which cannot be opened or created does not stop the chat;
it starts without a workspace, as it would without the template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The chat template dialog gains a switch and a workspace name for the
chats of the template, with the existing workspaces to pick from, like
in the form of assistant chat launchers. A note says when workspaces are
switched off and the name therefore has no effect for now.

The form of assistant chat launchers now says when a launcher without a
workspace opens its chat in the workspace of the chosen chat template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example configuration plugin, the Enterprise IT documentation, and
the README of the assistant plugins explain WorkspaceName: by name,
created on demand, only where a chat would otherwise be a disappearing
chat, and a launcher's own workspace wins. The changelog tells users
and IT departments about it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the profile a chat template preselects no longer exists, a new
chat kept whatever profile it had before, for example the one of the
previous chat. It now starts with the default profile of the chat
settings, which may be none, as the requirement for missing targets
says. A template which says nothing about profiles still keeps the
current profile, and assistant chat launchers are unchanged: there,
the launcher's own choice decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The localization run adds the texts of the profile, provider, and
workspace preselection of chat templates. The German translations were
reviewed afterward and aligned with the established wording, such as
"Chat-Vorlage", "selbstlöschender Chat", and "vorab auswählen".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@peerschuett
peerschuett requested review from a team as code owners October 21, 2026 14:06
@peerschuett
peerschuett marked this pull request as draft October 21, 2026 14:06
@peerschuett peerschuett self-assigned this Oct 21, 2026
@peerschuett peerschuett changed the title Chat templates choose profile provider workspace Added profile, provider, and workspace preselection to chat templates Oct 21, 2026
Peer Hogeterp and others added 5 commits October 21, 2026 16:29
A chat on the chat page got a thread in the workspace of its chat
template as soon as the page opened or the template was picked. That
created the workspace without a single message, brought back one the
user had deleted, and kept the chat in the workspace of the previous
template when the user switched to another one. The workspace is now
resolved when the chat gets something to keep: its first message, a
media import, or a draft kept when the page is left. A chat which sits
in the workspace of its template no longer stays there when the user
picks another template.

Switching from a template which preselects a profile or a provider to
one which says nothing kept that choice, although nobody made it for
the new chat. SettingsManager now decides this with
ChooseChatTemplateProfile and ChooseChatTemplateProvider: the choice
of the previous template falls back to the chat defaults, while one
the user made by hand stays.

Smaller fixes from the review:
- The import hints name a provider below the confidence level of
  chats and a profile of a template which forbids profiles.
- DirectChatService logs a failed template workspace once instead of
  twice, and its provider and profile decisions are tested.
- The example in plugin.lua no longer uses the zero GUID, which means
  "no profile" and is rejected as a provider ID.
- .gitignore covers pdfium.dll, the name of the library on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While workspaces are switched off, no chat goes into a workspace, so a
workspace chosen in the chat template dialog took effect for no chat,
and those chats did not move there later either. The dialog only showed
a small hint below the field.

The workspace switch and fields are now locked while workspaces are off,
and a warning above them says what happens instead. A workspace the
template already names stays as it is and applies again once workspaces
are back.
Without the RAG preview, the chat uses no data sources. The form of
assistant chat launchers still offered data sources and the note about
those of the chat template, and a launch still checked the sources of
the launcher or its template: one which was gone or not permitted
stopped the launch, although the chat would not have used it.

The form now hides both while RAG is off, and the launch skips the
check. The options travel into the chat unchanged and count again once
RAG is switched on, just like the data sources a chat template keeps.
Added new texts and localized them.
@peerschuett
peerschuett marked this pull request as ready for review October 22, 2026 08:41
@SommerEngineering
SommerEngineering merged commit 24c4c31 into MindWorkAI:main Oct 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants