Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.
JavaScript agent-collaborationagent-harnessagent-orchestrationagent-teamagent-workflowai-assistantai-automationai-employeeai-productivityai-teamai-workflowautonomous-agentsclaude-code-guiclaude-coworkdesktop-agentlocal-firstmulti-agentmulti-agent-systemself-evolving-agentstask-automation
Unify conversation title rule across the three creation entry points
wyt9077a3d2a3f6
diff --git a/src/renderer/modules/agents.js b/src/renderer/modules/agents.jsindex 8137d860..8b400df1 100644--- a/src/renderer/modules/agents.js+++ b/src/renderer/modules/agents.js@@ -1217,14 +1217,21 @@ async function useAgent(agentId, seedText) {const visible = (seedText || '').trim() || t('agents.run_prefix', { name: agent.name || agent.agent_id });+ // Don't pass a custom title — let backend `groupChat.send` auto-title+ // from the first user message, same rule as every other conv-creation+ // entry point (new-chat panel, commander @-mention). Optimistic title+ // is the run-prefix message itself so the sidebar entry shows the+ // user's intent ("运行 <name>") instead of bare agent name; this+ // matches what backend `autoTitle` will persist on the same `visible`.const res = await apiFetch('/api/conversations/create', {method: 'POST',headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ title: agent.name || '' }),+ body: JSON.stringify({}),});const data = await res.json();if (!data.ok) throw new Error(data.error || t('agents.create_conv_failed'));const conv = data.conversation;+ conv.title = _autoTitle(visible);conversations.unshift(conv);renderConversationList();setView('conversation', conv.conversation_id, { skipLoad: true });diff --git a/src/renderer/modules/conversation.js b/src/renderer/modules/conversation.jsindex 3f46bce2..98773a10 100644--- a/src/renderer/modules/conversation.js+++ b/src/renderer/modules/conversation.js@@ -1640,9 +1640,11 @@ async function handleNewChatSubmit() {if (!data.ok) throw new Error(data.error || t('chat.create_conv_failed'));const conv = data.conversation;convId = conv.conversation_id;- // Optimistic title from the user-visible text (raw, not the transformed form)- const optimistic = raw.replace(/\s+/g, ' ').trim();- conv.title = optimistic.length > 40 ? optimistic.slice(0, 40) + '…' : optimistic;+ // Optimistic title from the user-visible text (raw, not the transformed form).+ // Use the shared `_autoTitle` so this matches backend `autoTitle` —+ // otherwise the optimistic + backend-refreshed titles disagree and+ // the sidebar entry flips on the next loadConversations.+ conv.title = _autoTitle(raw);conversations.unshift(conv);renderConversationList();} catch (e) {diff --git a/src/renderer/modules/utils.js b/src/renderer/modules/utils.jsindex 93539423..7c592527 100644--- a/src/renderer/modules/utils.js+++ b/src/renderer/modules/utils.js@@ -393,6 +393,19 @@ function nowIsoLocal() {return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;}+/** Compose a sidebar title from arbitrary user-message text. Mirrors+ * backend `chats.ts::autoTitle` so the optimistic renderer-side title+ * and the backend-persisted title agree — without this match the new+ * conv first paints the optimistic value, then `loadConversations`+ * refreshes with backend's value and the sidebar entry visibly flips.+ * Empty input returns '' so the caller can fall back to its own+ * placeholder (`t('chat.new_conv_title')` for the conv list). */+function _autoTitle(text) {+ let s = String(text == null ? '' : text).trim().replace(/\n/g, ' ');+ if (s.length > 40) s = s.slice(0, 40) + '…';+ return s;+}+function formatTime(iso) {if (!iso) return '-';try {