refactor: remove personas

Personas were a misread requirement: SOUL is the chat identity and
identities are per action. The selected persona's prompt never reached the
model. Drops the resource, /personality, the chat selector, the settings
page and ChatService.SetPersona, and deletes stored persona documents.
This commit is contained in:
sam committed 2026-10-16 03:57:08 +11:00
1 parent 2c49fa5a55
commit 78e162fa0a
46 files changed
+384 -1416

No files matched your search

+6 -16
View File
@@ -2,35 +2,25 @@
import { computed } from "vue";
import { Button } from "@/components/ui/button";
import { selectorData, setModel, setPersona } from "./state";
import { selectorData, setModel } from "./state";
const props = defineProps<{ choose: "model" | "personality" }>();
defineProps<{ choose: "model" }>();
const options = computed(() =>
props.choose === "model" ? (selectorData.value.models ?? []) : (selectorData.value.personas ?? []),
);
const active = computed(() =>
props.choose === "model" ? selectorData.value.active_model : selectorData.value.active_persona,
);
function pick(value: string) {
if (props.choose === "model") void setModel(value);
else setPersona(value);
}
const options = computed(() => selectorData.value.models ?? []);
</script>
<template>
<div class="text-sm">
<p class="font-medium">{{ choose === "model" ? "Choose a model" : "Choose a personality" }}</p>
<p class="font-medium">Choose a model</p>
<p v-if="!options.length" class="mt-1 text-fg-muted">None configured.</p>
<div v-else class="mt-2 flex flex-wrap gap-2">
<Button
v-for="option in options"
:key="option"
size="sm"
:variant="option === active ? 'default' : 'outline'"
:variant="option === selectorData.active_model ? 'default' : 'outline'"
class="font-mono"
@click="pick(option)"
@click="void setModel(option)"
>{{ option }}</Button
>
</div>
-26
View File
@@ -20,11 +20,9 @@ import {
import {
currentModels,
selectedModel,
selectedPersona,
selectedProvider,
selectorData,
setModel,
setPersona,
setProvider,
statusText,
useEscapeLayer,
@@ -49,7 +47,6 @@ const DEFAULT = "__default__";
const open = ref(false);
useEscapeLayer(open);
const personaValue = computed(() => selectedPersona.value || DEFAULT);
const providerValue = computed(() => selectedProvider.value || DEFAULT);
const modelValue = computed(() => selectedModel.value || DEFAULT);
@@ -73,29 +70,6 @@ function clear(value: unknown): string {
<PopoverContent align="end" class="grid w-64 gap-3">
<span class="text-xs text-fg-subtle">{{ statusText }}</span>
<Field class="gap-1">
<FieldLabel class="text-xs text-fg-muted">Personality</FieldLabel>
<Select
:model-value="personaValue"
@update:model-value="setPersona(clear($event))"
>
<SelectTrigger size="sm" class="w-full" aria-label="Personality">
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem :value="DEFAULT">Default</SelectItem>
<SelectItem
v-for="name in selectorData.personas || []"
:key="name"
:value="name"
>{{ name }}</SelectItem
>
</SelectGroup>
</SelectContent>
</Select>
</Field>
<Field v-if="(selectorData.providers || []).length" class="gap-1">
<FieldLabel class="text-xs text-fg-muted">Provider</FieldLabel>
<Select
+6 -34
View File
@@ -93,8 +93,8 @@ export interface ChatMessage {
MessageID?: string;
/** An update check answered in the panel, with its install actions. */
update?: ChatUpdate;
/** A bare /model or /personality, answered with its choices. */
choose?: "model" | "personality";
/** A bare /model, answered with its choices. */
choose?: "model";
}
/** The update snapshot /update shows, and whether this host can install it. */
@@ -126,12 +126,9 @@ export interface ChatAsk {
/** Everything the selectors on the panel read, from one sessions read. */
export interface ChatSelectorData {
personas?: string[];
providers?: string[];
models?: string[];
models_by_provider?: Record<string, string[]>;
active_persona?: string;
active_personas?: Record<string, string>;
active_provider?: string;
active_model?: string;
commands?: Array<ChatCommandSpec | string>;
@@ -178,7 +175,6 @@ export const isSending = ref(false);
export const streamingTurn = ref<StreamingTurn | null>(null);
export const selectorData = ref<ChatSelectorData>({});
export const selectedPersona = ref("");
export const selectedProvider = ref("");
export const selectedModel = ref("");
@@ -235,7 +231,6 @@ export async function refreshSessions(): Promise<void> {
sessions.value = sessionList;
selectorData.value = data;
selectedPersona.value = data.active_persona || "";
const providers = data.providers || [];
selectedProvider.value = data.active_provider || providers[0] || "";
selectedModel.value = data.active_model || "";
@@ -256,13 +251,10 @@ export async function refreshSessions(): Promise<void> {
export async function selectSession(id: string): Promise<void> {
if (!id) return;
const data = selectorData.value;
currentSession.value = id;
messages.value = [];
streamingTurn.value = null;
selectedPersona.value =
data.active_personas?.[id] || data.active_persona || "";
try {
// Resuming is the server's own command, so the transcript read below is of
@@ -327,25 +319,6 @@ export function promptSessionCommand(command: string, message: string): void {
if (value?.trim()) void runSessionCommand(`${command} ${value.trim()}`);
}
export function setPersona(name: string): void {
selectedPersona.value = name;
const session = currentSession.value;
if (!session || !name) return;
api
.chatPersona(session, name)
.then(() => {
const data = selectorData.value;
selectorData.value = {
...data,
active_personas: { ...(data.active_personas || {}), [session]: name },
};
statusText.value = `Personality: ${name}`;
})
.catch((err: Error) => {
statusText.value = err.message || "Failed to set personality";
});
}
export async function setProvider(provider: string): Promise<void> {
selectedProvider.value = provider;
if (!provider) return;
@@ -425,11 +398,10 @@ export async function sendMessage(retryOpts?: RetryOptions): Promise<void> {
composerText.value = "";
}
// Bare /model and /personality offer their choices as buttons, as Telegram
// does; with an argument they go to the gateway like any command.
if (!isRetry && (text.trim() === "/model" || text.trim() === "/personality")) {
const choose = text.trim() === "/model" ? "model" : "personality";
messages.value = [...messages.value, { from: "assistant", text: "", choose }];
// A bare /model offers its choices as buttons, as Telegram does; with an
// argument it goes to the gateway like any command.
if (!isRetry && text.trim() === "/model") {
messages.value = [...messages.value, { from: "assistant", text: "", choose: "model" }];
isSending.value = false;
statusText.value = "Ready";
return;