🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🐛 fix(spend): keep Agent Signal verbatim, split task-result wakeups (#22253)
AmAzing-867a15a24b42
diff --git a/.i18nrc.js b/.i18nrc.jsindex 4c18ca557cc..184fb8e6384 100644--- a/.i18nrc.js+++ b/.i18nrc.js@@ -37,7 +37,7 @@ module.exports = defineConfig({' appears in the source: same names, same count. Never add a variable the',' source does not have, and never drop one it does.','- Leave product and brand names untranslated: LobeHub, LobeAI, Claude Code,',- ' Codex, OpenAI, Azure, GitHub, MCP.',+ ' Codex, OpenAI, Azure, GitHub, MCP, Agent Signal.','','Turkish (tr-TR) glossary:','- Agent -> Ajan. Not Temsilci, Aracı, Asistan or Ajans. "Ajans" means an',diff --git a/apps/server/src/services/agentRuntime/foregroundOperation.test.ts b/apps/server/src/services/agentRuntime/foregroundOperation.test.tsnew file mode 100644index 00000000000..b5153805667--- /dev/null+++ b/apps/server/src/services/agentRuntime/foregroundOperation.test.ts@@ -0,0 +1,29 @@+import { RequestTrigger } from '@lobechat/types';+import { describe, expect, it } from 'vitest';++import { isComposerSupersedableTrigger, isForegroundOperationTrigger } from './foregroundOperation';++describe('foreground operation triggers', () => {+ // Both can hold the main-spine marker without the client tracking them, so a+ // composer send must be able to retire either.+ it.each([RequestTrigger.TaskCallback, RequestTrigger.AgentSignal])(+ 'treats %s as a server-started run the composer may retire',+ (trigger) => {+ expect(isForegroundOperationTrigger(trigger)).toBe(false);+ expect(isComposerSupersedableTrigger(trigger)).toBe(true);+ },+ );++ it.each([RequestTrigger.Task, RequestTrigger.Cron])(+ 'leaves %s runs to finish when the user sends',+ (trigger) => {+ expect(isForegroundOperationTrigger(trigger)).toBe(false);+ expect(isComposerSupersedableTrigger(trigger)).toBe(false);+ },+ );++ it('lets the composer retire foreground runs, including legacy rows without a trigger', () => {+ expect(isComposerSupersedableTrigger(RequestTrigger.Chat)).toBe(true);+ expect(isComposerSupersedableTrigger(undefined)).toBe(true);+ });+});diff --git a/apps/server/src/services/agentRuntime/foregroundOperation.ts b/apps/server/src/services/agentRuntime/foregroundOperation.tsindex 1179ec14948..e43920d730b 100644--- a/apps/server/src/services/agentRuntime/foregroundOperation.ts+++ b/apps/server/src/services/agentRuntime/foregroundOperation.ts@@ -19,6 +19,7 @@ export const BACKGROUND_OPERATION_TRIGGERS: ReadonlySet<string> = new Set<stringRequestTrigger.Scheduled,RequestTrigger.Scm,RequestTrigger.Task,+ RequestTrigger.TaskCallback,RequestTrigger.Verify,]);@@ -29,16 +30,17 @@ export const isForegroundOperationTrigger = (trigger: string | null | undefined)* Whether a composer send should retire this run when it still owns the* topic's `runningOperation` marker.*- * Foreground runs, plus Agent Signal runs: a run that holds the main-spine- * marker with that trigger (e.g. the creator wakeup that processes task- * results) continues the user's own conversation, yet the server started it,- * so the client has no local op to queue behind. Leaving it live next to the- * send forks the spine, and the user's message ends up on a branch the- * conversation never shows. Agent Signal runs on isolation threads never own- * the marker, so they are unaffected.+ * Foreground runs, plus server-started runs that can hold the main-spine+ * marker: the creator wakeup that processes task results (`TaskCallback`), and+ * an Agent Signal run that fell back to the main topic without an isolation+ * thread. The client never started either, so it has no local op to queue+ * behind. Leaving one live next to the send forks the spine, and the user's+ * message ends up on a branch the conversation never shows.*/export const isComposerSupersedableTrigger = (trigger: string | null | undefined): boolean =>- isForegroundOperationTrigger(trigger) || trigger === RequestTrigger.AgentSignal;+ isForegroundOperationTrigger(trigger) ||+ trigger === RequestTrigger.AgentSignal ||+ trigger === RequestTrigger.TaskCallback;/*** How a composer send found the topic's previous foreground run still `running`.diff --git a/apps/server/src/services/agentSignal/policies/analyzeIntent/__tests__/feedbackAction.inlineLane.test.ts b/apps/server/src/services/agentSignal/policies/analyzeIntent/__tests__/feedbackAction.inlineLane.test.tsnew file mode 100644index 00000000000..94f35ec06ce--- /dev/null+++ b/apps/server/src/services/agentSignal/policies/analyzeIntent/__tests__/feedbackAction.inlineLane.test.ts@@ -0,0 +1,130 @@+// @vitest-environment node+import { RequestTrigger } from '@lobechat/types';+import { describe, expect, it, vi } from 'vitest';++import { createProcedurePolicyOptions } from '../../../procedure';+import { createRuntimeProcessorContext } from '../../../runtime/context';+import type { AgentSignalPolicyStateStore } from '../../../store/types';+import type { SignalFeedbackDomainSkill } from '../../types';+import { createFeedbackActionPlannerSignalHandler } from '../feedbackAction';++const context = createRuntimeProcessorContext({+ backend: {+ async getGuardState() {+ return {};+ },+ async touchGuardState() {+ return {};+ },+ },+ scopeKey: 'topic:thread_1',+});++const createStore = (): AgentSignalPolicyStateStore => {+ const state = new Map<string, Record<string, string>>();++ return {+ readPolicyState: async (policyId, scopeKey) => state.get(`${policyId}:${scopeKey}`),+ writePolicyState: async (policyId, scopeKey, data) => {+ const key = `${policyId}:${scopeKey}`;+ state.set(key, { ...state.get(key), ...data });+ },+ };+};++const createServerInboundSkillSignal = (trigger: string): SignalFeedbackDomainSkill => ({+ chain: { chainId: 'chain_1', parentNodeId: 'sig_skill_inline', rootSourceId: 'source_inline' },+ payload: {+ confidence: 0.9,+ conflictPolicy: { forbiddenWith: ['none'], mode: 'fanout', priority: 80 },+ evidence: [{ cue: 'test', excerpt: 'Research and build an MVP, then write a report.' }],+ message: 'Research and build an MVP, then write a report.',+ messageId: 'msg_skill_inline',+ reason: 'test-domain-signal',+ satisfactionResult: 'not_satisfied',+ skillActionIntent: 'create',+ skillIntentConfidence: 0.9,+ skillIntentExplicitness: 'implicit_strong_learning',+ skillIntentReason: 'a reusable task execution pattern',+ skillRoute: 'direct_decision',+ target: 'skill',+ trigger,+ },+ signalId: 'sig_skill_inline',+ signalType: 'signal.feedback.domain.skill',+ source: {+ payload: {+ serializedContext:+ '<feedback_analysis_context><message>context</message></feedback_analysis_context>',+ },+ sourceId: 'source_inline',+ sourceType: 'agent.user.message',+ },+ timestamp: 1,+});++describe('feedbackActionPlanner inline skill lane', () => {+ /**+ * Agent Signal self-iteration runs and task-result wakeups (whose sub-agents+ * inherit the trigger) are server-started follow-ups: a direct skill decision+ * dispatches inline instead of being parked for completion-stage synthesis.+ */+ it.each([RequestTrigger.AgentSignal, RequestTrigger.TaskCallback])(+ 'dispatches a %s skill candidate inline instead of parking it',+ async (trigger) => {+ const procedure = createProcedurePolicyOptions({+ now: () => 123,+ policyStateStore: createStore(),+ ttlSeconds: 3600,+ });+ const writeIntentRecord = vi.spyOn(procedure.procedureState.skillIntentRecords!, 'write');+ const action = {+ actionId: 'action_inline',+ actionType: 'action.skill-management.handle' as const,+ payload: {},+ };+ const skillActions = {+ prepare: vi.fn(() => ({ action, reason: 'inline', risk: 'low' as const })),+ };+ const handler = createFeedbackActionPlannerSignalHandler({+ actionServices: {+ memoryActions: { prepare: vi.fn() },+ skillActions: skillActions as never,+ },+ procedure: { now: () => 123, procedureState: procedure.procedureState },+ });++ const result = await handler.handle(createServerInboundSkillSignal(trigger), context);++ expect(result).toEqual({ actions: [action], status: 'dispatch' });+ expect(writeIntentRecord).not.toHaveBeenCalled();+ },+ );++ it('still parks an ordinary server-inbound skill candidate', async () => {+ const procedure = createProcedurePolicyOptions({+ now: () => 123,+ policyStateStore: createStore(),+ ttlSeconds: 3600,+ });+ const skillActions = { prepare: vi.fn() };+ const handler = createFeedbackActionPlannerSignalHandler({+ actionServices: {+ memoryActions: { prepare: vi.fn() },+ skillActions: skillActions as never,+ },+ procedure: { now: () => 123, procedureState: procedure.procedureState },+ });++ const result = await handler.handle(+ createServerInboundSkillSignal(RequestTrigger.Chat),+ context,+ );++ expect(result).toEqual({+ concluded: { reason: 'skill candidate parked until agent.execution.completed' },+ status: 'conclude',+ });+ expect(skillActions.prepare).not.toHaveBeenCalled();+ });+});diff --git a/apps/server/src/services/agentSignal/policies/analyzeIntent/feedbackAction.ts b/apps/server/src/services/agentSignal/policies/analyzeIntent/feedbackAction.tsindex baa23ce79b8..73f7de62d23 100644--- a/apps/server/src/services/agentSignal/policies/analyzeIntent/feedbackAction.ts+++ b/apps/server/src/services/agentSignal/policies/analyzeIntent/feedbackAction.ts@@ -138,7 +138,10 @@ const detectServerInboundDeferredSkill = (signal: FeedbackDomainSignal): booleanif (!trigger) return false;if (trigger === AGENT_SIGNAL_SOURCE_TYPES.clientRuntimeStart) return false;if (trigger === AGENT_SIGNAL_SOURCE_TYPES.clientRuntimeComplete) return false;- if (trigger === RequestTrigger.AgentSignal) return false;+ // Task-result wakeups (and their sub-agents, which inherit the trigger) are+ // server-started follow-ups like Agent Signal runs, so they dispatch inline too.+ if (trigger === RequestTrigger.AgentSignal || trigger === RequestTrigger.TaskCallback)+ return false;return true;};diff --git a/apps/server/src/services/aiAgent/__tests__/execAgent.supersedeRunningOperation.test.ts b/apps/server/src/services/aiAgent/__tests__/execAgent.supersedeRunningOperation.test.tsindex 8dded3fc034..0d725d5678b 100644--- a/apps/server/src/services/aiAgent/__tests__/execAgent.supersedeRunningOperation.test.ts+++ b/apps/server/src/services/aiAgent/__tests__/execAgent.supersedeRunningOperation.test.ts@@ -330,15 +330,15 @@ describe('AiAgentService.execAgent - supersede running foreground operation', ()expect(interruptTask).toHaveBeenCalledWith({ operationId: 'op-live', topicId: 'topic-1' });});- // A task-result wakeup runs on the main spine with `agent_signal`. The client+ // A task-result wakeup runs on the main spine with `task_callback`. The client// never started it, so it cannot queue the send behind it; leaving both live// forked the conversation and hid the user's message on the losing branch.- it('interrupts a running agent_signal holder on the main spine', async () => {+ it('interrupts a running task_callback holder on the main spine', async () => {mockFindOperationById.mockResolvedValue({id: 'op-live',status: 'running',topicId: 'topic-1',- trigger: 'agent_signal',+ trigger: 'task_callback',userId: 'test-user-id',});diff --git a/apps/server/src/services/aiAgent/pipeline/topicStart.ts b/apps/server/src/services/aiAgent/pipeline/topicStart.tsindex 4e1f6761c3f..18cce6c1e05 100644--- a/apps/server/src/services/aiAgent/pipeline/topicStart.ts+++ b/apps/server/src/services/aiAgent/pipeline/topicStart.ts@@ -82,7 +82,7 @@ export const resolveReplacedOperationId = async (* - a parked run (`waiting_for_human` etc.) — the send may be its answer;* - a background producer's run (task, cron, bot, …), see* `isComposerSupersedableTrigger` in `agentRuntime/foregroundOperation`.- * An Agent Signal run on the main spine (task-result wakeup) is retired+ * A task-result wakeup or an Agent Signal run on the main spine is retired* like a foreground run: the client never tracks it, so it cannot queue;* - a device-hosted Claude Code / Codex run: cancelling it waits up to 10s* for the device, far past the reservation's ~3s retry budget, so adiff --git a/apps/server/src/services/taskResultBridge/index.test.ts b/apps/server/src/services/taskResultBridge/index.test.tsindex 5ddb8a49a9e..a5ec78ac901 100644--- a/apps/server/src/services/taskResultBridge/index.test.ts+++ b/apps/server/src/services/taskResultBridge/index.test.ts@@ -1,4 +1,5 @@// @vitest-environment node+import { RequestTrigger } from '@lobechat/types';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { MessageModel } from '@/database/models/message';@@ -209,6 +210,9 @@ describe('TaskResultBridgeService.deliver', () => {appContext: { topicId: 'topic-origin' },parentMessageId: 'task-cb-task-1-topic-done',suppressUserMessage: true,+ // Its own trigger, not Agent Signal: the wakeup is billed and listed as task follow-up,+ // and the Labs → Self-evolving switch that gates Agent Signal does not control it.+ trigger: RequestTrigger.TaskCallback,});expect(releaseReservation).toHaveBeenCalledWith('topic-origin', 'task-result-wakeup-receipt-1');});diff --git a/apps/server/src/services/taskResultBridge/index.ts b/apps/server/src/services/taskResultBridge/index.tsindex 52dfaf25dd1..24f5b650442 100644--- a/apps/server/src/services/taskResultBridge/index.ts+++ b/apps/server/src/services/taskResultBridge/index.ts@@ -260,7 +260,7 @@ export class TaskResultBridgeService {prompt: `Process ${receipts.length} completed task result${receipts.length === 1 ? '' : 's'}`,suppressUserMessage: true,topicStartReservationId: reservationId,- trigger: RequestTrigger.AgentSignal,+ trigger: RequestTrigger.TaskCallback,userInterventionConfig,});await callbackStore.attachCreatorOperation(receiptIds, result.operationId);diff --git a/locales/ar/chat.json b/locales/ar/chat.jsonindex 3e2857a6529..45f3f2970c5 100644--- a/locales/ar/chat.json+++ b/locales/ar/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} مهارة","agentProfile.skills_other": "{{count}} مهارات","agentSender.sourceTopic": "موضوع المصدر",- "agentSignal.receipts.agentSignalLabel": "إشارة الوكيل","agentSignal.receipts.memory.detail": "تم حفظ هذا للردود المستقبلية","agentSignal.receipts.memory.openInMemory": "افتح في الذاكرة","agentSignal.receipts.memory.title": "تم حفظ الذاكرة",diff --git a/locales/ar/spend.json b/locales/ar/spend.jsonindex 617c3f46722..06ec61ef26c 100644--- a/locales/ar/spend.json+++ b/locales/ar/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "استخدام الرموز","table.columns.trigger.enums.agent_meta": "ملف الوكيل","table.columns.trigger.enums.agent_share": "مشاركة الوكيل",- "table.columns.trigger.enums.agent_signal": "إشارة الوكيل",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "استدعاء API","table.columns.trigger.enums.asr": "نسخ الصوت","table.columns.trigger.enums.bot": "رسالة بوت",diff --git a/locales/bg-BG/chat.json b/locales/bg-BG/chat.jsonindex 017dbb444fc..87f4a5a38e9 100644--- a/locales/bg-BG/chat.json+++ b/locales/bg-BG/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} умение","agentProfile.skills_other": "{{count}} умения","agentSender.sourceTopic": "Изходна тема",- "agentSignal.receipts.agentSignalLabel": "Сигнал на агент","agentSignal.receipts.memory.detail": "Запазено за бъдещи отговори","agentSignal.receipts.memory.openInMemory": "Отвори в паметта","agentSignal.receipts.memory.title": "Паметта е запазена",diff --git a/locales/bg-BG/spend.json b/locales/bg-BG/spend.jsonindex 169b84f9287..0c67a9bb05e 100644--- a/locales/bg-BG/spend.json+++ b/locales/bg-BG/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Използвани токени","table.columns.trigger.enums.agent_meta": "Профил на агент","table.columns.trigger.enums.agent_share": "Споделяне от агент",- "table.columns.trigger.enums.agent_signal": "Сигнал от агент",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API Обаждане","table.columns.trigger.enums.asr": "Гласово транскрибиране","table.columns.trigger.enums.bot": "Съобщение от бот",diff --git a/locales/de-DE/chat.json b/locales/de-DE/chat.jsonindex 2a443dfb5be..36ef5aaac33 100644--- a/locales/de-DE/chat.json+++ b/locales/de-DE/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} Fähigkeit","agentProfile.skills_other": "{{count}} Fähigkeiten","agentSender.sourceTopic": "Quellthema",- "agentSignal.receipts.agentSignalLabel": "Agentensignal","agentSignal.receipts.memory.detail": "Für zukünftige Antworten gespeichert","agentSignal.receipts.memory.openInMemory": "Im Speicher öffnen","agentSignal.receipts.memory.title": "Erinnerung gespeichert",diff --git a/locales/de-DE/spend.json b/locales/de-DE/spend.jsonindex 8f4f23d531b..98e142ed414 100644--- a/locales/de-DE/spend.json+++ b/locales/de-DE/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Token-Nutzung","table.columns.trigger.enums.agent_meta": "Agentenprofil","table.columns.trigger.enums.agent_share": "Agentenanteil",- "table.columns.trigger.enums.agent_signal": "Agentensignal",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API-Aufruf","table.columns.trigger.enums.asr": "Sprachtranskription","table.columns.trigger.enums.bot": "Bot-Nachricht",diff --git a/locales/en-US/chat.json b/locales/en-US/chat.jsonindex e50ebb5cc1d..9b4e54086b4 100644--- a/locales/en-US/chat.json+++ b/locales/en-US/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} skill","agentProfile.skills_other": "{{count}} skills","agentSender.sourceTopic": "Source topic",- "agentSignal.receipts.agentSignalLabel": "Agent Signal","agentSignal.receipts.memory.detail": "Saved this for future replies","agentSignal.receipts.memory.openInMemory": "Open in Memory","agentSignal.receipts.memory.title": "Memory saved",diff --git a/locales/en-US/spend.json b/locales/en-US/spend.jsonindex 6f12c922344..36b2a26c03d 100644--- a/locales/en-US/spend.json+++ b/locales/en-US/spend.json@@ -16,9 +16,11 @@"table.columns.spendUsd": "Cost","table.columns.time": "Time","table.columns.totalTokens": "Token usage",+ "table.columns.trigger.agentSignal.desc": "Background work Self-evolving does on conversations: reading feedback after each message, saving memories, refining skills and nightly reviews.",+ "table.columns.trigger.agentSignal.openSettings": "Open Labs → Self-evolving","table.columns.trigger.enums.agent_meta": "Agent profile","table.columns.trigger.enums.agent_share": "Agent Share",- "table.columns.trigger.enums.agent_signal": "Agent signal",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API call","table.columns.trigger.enums.asr": "Voice transcription","table.columns.trigger.enums.bot": "Bot message",@@ -48,6 +50,7 @@"table.columns.trigger.enums.semantic_search": "Knowledge search","table.columns.trigger.enums.signup_email_llm_review": "Signup email review","table.columns.trigger.enums.task": "Task",+ "table.columns.trigger.enums.task_callback": "Task result follow-up","table.columns.trigger.enums.thread_title": "Thread title","table.columns.trigger.enums.topic": "Topic title (legacy)","table.columns.trigger.enums.topic_analysis": "Topic analysis",diff --git a/locales/es-ES/chat.json b/locales/es-ES/chat.jsonindex 4c044090c8a..27833acfb3b 100644--- a/locales/es-ES/chat.json+++ b/locales/es-ES/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} habilidad","agentProfile.skills_other": "{{count}} habilidades","agentSender.sourceTopic": "Tema de origen",- "agentSignal.receipts.agentSignalLabel": "Señal del Agente","agentSignal.receipts.memory.detail": "Guardado para respuestas futuras","agentSignal.receipts.memory.openInMemory": "Abrir en Memoria","agentSignal.receipts.memory.title": "Memoria guardada",diff --git a/locales/es-ES/spend.json b/locales/es-ES/spend.jsonindex 55a6e73bfa3..f95092406fd 100644--- a/locales/es-ES/spend.json+++ b/locales/es-ES/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Uso de tokens","table.columns.trigger.enums.agent_meta": "Perfil del Agente","table.columns.trigger.enums.agent_share": "Participación del Agente",- "table.columns.trigger.enums.agent_signal": "Señal del agente",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "Llamada API","table.columns.trigger.enums.asr": "Transcripción de Voz","table.columns.trigger.enums.bot": "Mensaje del Bot",diff --git a/locales/fa-IR/chat.json b/locales/fa-IR/chat.jsonindex ed9819e20d8..5b13c6ec49a 100644--- a/locales/fa-IR/chat.json+++ b/locales/fa-IR/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} مهارت","agentProfile.skills_other": "{{count}} مهارت","agentSender.sourceTopic": "موضوع منبع",- "agentSignal.receipts.agentSignalLabel": "سیگنال نماینده","agentSignal.receipts.memory.detail": "این را برای پاسخهای آینده ذخیره کرد","agentSignal.receipts.memory.openInMemory": "باز کردن در حافظه","agentSignal.receipts.memory.title": "حافظه ذخیره شد",diff --git a/locales/fa-IR/spend.json b/locales/fa-IR/spend.jsonindex 8041fe33d5f..d91085f24f6 100644--- a/locales/fa-IR/spend.json+++ b/locales/fa-IR/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "میزان استفاده از توکن","table.columns.trigger.enums.agent_meta": "پروفایل عامل","table.columns.trigger.enums.agent_share": "سهم نماینده",- "table.columns.trigger.enums.agent_signal": "سیگنال عامل",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "تماس API","table.columns.trigger.enums.asr": "رونویسی صوتی","table.columns.trigger.enums.bot": "پیام ربات",diff --git a/locales/fr-FR/chat.json b/locales/fr-FR/chat.jsonindex 86a7aaa18f5..a001798f5a2 100644--- a/locales/fr-FR/chat.json+++ b/locales/fr-FR/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} compétence","agentProfile.skills_other": "{{count}} compétences","agentSender.sourceTopic": "Sujet source",- "agentSignal.receipts.agentSignalLabel": "Signal de l'agent","agentSignal.receipts.memory.detail": "Enregistré pour des réponses futures","agentSignal.receipts.memory.openInMemory": "Ouvrir dans la Mémoire","agentSignal.receipts.memory.title": "Mémoire enregistrée",diff --git a/locales/fr-FR/spend.json b/locales/fr-FR/spend.jsonindex 6f065150ef1..ae37efdb6bb 100644--- a/locales/fr-FR/spend.json+++ b/locales/fr-FR/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Utilisation des jetons","table.columns.trigger.enums.agent_meta": "Profil de l'Agent","table.columns.trigger.enums.agent_share": "Partage de l'agent",- "table.columns.trigger.enums.agent_signal": "Signal de l'agent",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "Appel API","table.columns.trigger.enums.asr": "Transcription vocale","table.columns.trigger.enums.bot": "Message Bot",diff --git a/locales/it-IT/chat.json b/locales/it-IT/chat.jsonindex 6386c7247c8..60a5802092f 100644--- a/locales/it-IT/chat.json+++ b/locales/it-IT/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} competenza","agentProfile.skills_other": "{{count}} competenze","agentSender.sourceTopic": "Argomento di origine",- "agentSignal.receipts.agentSignalLabel": "Segnale Agente","agentSignal.receipts.memory.detail": "Salvato per risposte future","agentSignal.receipts.memory.openInMemory": "Apri in Memoria","agentSignal.receipts.memory.title": "Memoria salvata",diff --git a/locales/it-IT/spend.json b/locales/it-IT/spend.jsonindex 4efe439d4c7..2fda27cccca 100644--- a/locales/it-IT/spend.json+++ b/locales/it-IT/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Utilizzo Token","table.columns.trigger.enums.agent_meta": "Profilo Agente","table.columns.trigger.enums.agent_share": "Condivisione Agente",- "table.columns.trigger.enums.agent_signal": "Segnale dell'agente",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "Chiamata API","table.columns.trigger.enums.asr": "Trascrizione vocale","table.columns.trigger.enums.bot": "Messaggio Bot",diff --git a/locales/ja-JP/chat.json b/locales/ja-JP/chat.jsonindex edb31821a73..57822799d58 100644--- a/locales/ja-JP/chat.json+++ b/locales/ja-JP/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} 件のスキル","agentProfile.skills_other": "{{count}} 件のスキル","agentSender.sourceTopic": "ソーストピック",- "agentSignal.receipts.agentSignalLabel": "エージェントシグナル","agentSignal.receipts.memory.detail": "将来の返信のために保存しました","agentSignal.receipts.memory.openInMemory": "メモリで開く","agentSignal.receipts.memory.title": "メモリーが保存されました",diff --git a/locales/ja-JP/spend.json b/locales/ja-JP/spend.jsonindex 6b67a1a396c..77ed4c3b1ea 100644--- a/locales/ja-JP/spend.json+++ b/locales/ja-JP/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "トークン使用量","table.columns.trigger.enums.agent_meta": "エージェントプロファイル","table.columns.trigger.enums.agent_share": "エージェント共有",- "table.columns.trigger.enums.agent_signal": "エージェント信号",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "APIコール","table.columns.trigger.enums.asr": "音声文字変換","table.columns.trigger.enums.bot": "ボットメッセージ",diff --git a/locales/ko-KR/chat.json b/locales/ko-KR/chat.jsonindex 7f4829de287..a9d24ac8f56 100644--- a/locales/ko-KR/chat.json+++ b/locales/ko-KR/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}}개 스킬","agentProfile.skills_other": "{{count}}개 스킬","agentSender.sourceTopic": "소스 주제",- "agentSignal.receipts.agentSignalLabel": "에이전트 신호","agentSignal.receipts.memory.detail": "미래의 응답을 위해 저장되었습니다","agentSignal.receipts.memory.openInMemory": "메모리에서 열기","agentSignal.receipts.memory.title": "메모리 저장됨",diff --git a/locales/ko-KR/spend.json b/locales/ko-KR/spend.jsonindex 92219506c9f..440574efd76 100644--- a/locales/ko-KR/spend.json+++ b/locales/ko-KR/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "토큰 사용량","table.columns.trigger.enums.agent_meta": "에이전트 프로필","table.columns.trigger.enums.agent_share": "에이전트 공유",- "table.columns.trigger.enums.agent_signal": "에이전트 신호",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API 호출","table.columns.trigger.enums.asr": "음성 전사","table.columns.trigger.enums.bot": "봇 메시지",diff --git a/locales/nl-NL/chat.json b/locales/nl-NL/chat.jsonindex 6662a278596..5199ea6472f 100644--- a/locales/nl-NL/chat.json+++ b/locales/nl-NL/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} vaardigheid","agentProfile.skills_other": "{{count}} vaardigheden","agentSender.sourceTopic": "Brononderwerp",- "agentSignal.receipts.agentSignalLabel": "Agent Signaal","agentSignal.receipts.memory.detail": "Opgeslagen voor toekomstige antwoorden","agentSignal.receipts.memory.openInMemory": "Openen in Geheugen","agentSignal.receipts.memory.title": "Geheugen opgeslagen",diff --git a/locales/nl-NL/spend.json b/locales/nl-NL/spend.jsonindex 3947bdea39f..0663b02a674 100644--- a/locales/nl-NL/spend.json+++ b/locales/nl-NL/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Tokenverbruik","table.columns.trigger.enums.agent_meta": "Agentprofiel","table.columns.trigger.enums.agent_share": "Agent Delen",- "table.columns.trigger.enums.agent_signal": "Agent Signaal",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API-oproep","table.columns.trigger.enums.asr": "Spraaktranscriptie","table.columns.trigger.enums.bot": "Botbericht",diff --git a/locales/pl-PL/chat.json b/locales/pl-PL/chat.jsonindex ea5bb84dbbb..81165136d50 100644--- a/locales/pl-PL/chat.json+++ b/locales/pl-PL/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} umiejętność","agentProfile.skills_other": "{{count}} umiejętności","agentSender.sourceTopic": "Temat źródłowy",- "agentSignal.receipts.agentSignalLabel": "Sygnał agenta","agentSignal.receipts.memory.detail": "Zapisano to na potrzeby przyszłych odpowiedzi","agentSignal.receipts.memory.openInMemory": "Otwórz w Pamięci","agentSignal.receipts.memory.title": "Pamięć zapisana",diff --git a/locales/pl-PL/spend.json b/locales/pl-PL/spend.jsonindex 45af03cc2eb..2f554763912 100644--- a/locales/pl-PL/spend.json+++ b/locales/pl-PL/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Zużycie tokenów","table.columns.trigger.enums.agent_meta": "Profil Agenta","table.columns.trigger.enums.agent_share": "Udział agenta",- "table.columns.trigger.enums.agent_signal": "Sygnał agenta",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "Wywołanie API","table.columns.trigger.enums.asr": "Transkrypcja głosowa","table.columns.trigger.enums.bot": "Wiadomość Bota",diff --git a/locales/pt-BR/chat.json b/locales/pt-BR/chat.jsonindex 53cfea1ecb5..b12187de3fa 100644--- a/locales/pt-BR/chat.json+++ b/locales/pt-BR/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} habilidade","agentProfile.skills_other": "{{count}} habilidades","agentSender.sourceTopic": "Tópico de origem",- "agentSignal.receipts.agentSignalLabel": "Sinal do Agente","agentSignal.receipts.memory.detail": "Salvo para respostas futuras","agentSignal.receipts.memory.openInMemory": "Abrir na Memória","agentSignal.receipts.memory.title": "Memória salva",diff --git a/locales/pt-BR/spend.json b/locales/pt-BR/spend.jsonindex dedfb5dad81..2e3f04907d6 100644--- a/locales/pt-BR/spend.json+++ b/locales/pt-BR/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Uso de Tokens","table.columns.trigger.enums.agent_meta": "Perfil do Agente","table.columns.trigger.enums.agent_share": "Compartilhamento do Agente",- "table.columns.trigger.enums.agent_signal": "Sinal do Agente",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "Chamada de API","table.columns.trigger.enums.asr": "Transcrição de Voz","table.columns.trigger.enums.bot": "Mensagem do Bot",diff --git a/locales/ru-RU/chat.json b/locales/ru-RU/chat.jsonindex 9b9b35a2e59..50f0b3f4739 100644--- a/locales/ru-RU/chat.json+++ b/locales/ru-RU/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} навык","agentProfile.skills_other": "{{count}} навыков","agentSender.sourceTopic": "Исходная тема",- "agentSignal.receipts.agentSignalLabel": "Сигнал агента","agentSignal.receipts.memory.detail": "Сохранено для будущих ответов","agentSignal.receipts.memory.openInMemory": "Открыть в памяти","agentSignal.receipts.memory.title": "Память сохранена",diff --git a/locales/ru-RU/spend.json b/locales/ru-RU/spend.jsonindex 59ebc3cbe64..95c4c88313e 100644--- a/locales/ru-RU/spend.json+++ b/locales/ru-RU/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Использование токенов","table.columns.trigger.enums.agent_meta": "Профиль Агента","table.columns.trigger.enums.agent_share": "Доля агента",- "table.columns.trigger.enums.agent_signal": "Сигнал агента",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "Вызов API","table.columns.trigger.enums.asr": "Распознавание речи","table.columns.trigger.enums.bot": "Сообщение бота",diff --git a/locales/tr-TR/chat.json b/locales/tr-TR/chat.jsonindex dc78074d052..31765d1d2bd 100644--- a/locales/tr-TR/chat.json+++ b/locales/tr-TR/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} beceri","agentProfile.skills_other": "{{count}} beceri","agentSender.sourceTopic": "Kaynak konu",- "agentSignal.receipts.agentSignalLabel": "Ajan Sinyali","agentSignal.receipts.memory.detail": "Bunu gelecekteki yanıtlar için kaydettim","agentSignal.receipts.memory.openInMemory": "Bellekte Aç","agentSignal.receipts.memory.title": "Hafıza kaydedildi",diff --git a/locales/tr-TR/spend.json b/locales/tr-TR/spend.jsonindex 20ea12a6a12..374ca8e3882 100644--- a/locales/tr-TR/spend.json+++ b/locales/tr-TR/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Token Kullanımı","table.columns.trigger.enums.agent_meta": "Ajan Profili","table.columns.trigger.enums.agent_share": "Ajan Payı",- "table.columns.trigger.enums.agent_signal": "Ajan Sinyali",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API Çağrısı","table.columns.trigger.enums.asr": "Ses Transkripsiyonu","table.columns.trigger.enums.bot": "Bot Mesajı",diff --git a/locales/vi-VN/chat.json b/locales/vi-VN/chat.jsonindex c6669e72e8e..4b50de8b016 100644--- a/locales/vi-VN/chat.json+++ b/locales/vi-VN/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} kỹ năng","agentProfile.skills_other": "{{count}} kỹ năng","agentSender.sourceTopic": "Chủ đề nguồn",- "agentSignal.receipts.agentSignalLabel": "Tín hiệu Đại lý","agentSignal.receipts.memory.detail": "Đã lưu để trả lời trong tương lai","agentSignal.receipts.memory.openInMemory": "Mở trong Bộ nhớ","agentSignal.receipts.memory.title": "Đã lưu ký ức",diff --git a/locales/vi-VN/spend.json b/locales/vi-VN/spend.jsonindex 28950d0ff82..598495dc393 100644--- a/locales/vi-VN/spend.json+++ b/locales/vi-VN/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "Sử dụng token","table.columns.trigger.enums.agent_meta": "Hồ sơ Agent","table.columns.trigger.enums.agent_share": "Chia sẻ của đại lý",- "table.columns.trigger.enums.agent_signal": "Tín hiệu đại lý",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "Gọi API","table.columns.trigger.enums.asr": "Chuyển giọng nói thành văn bản","table.columns.trigger.enums.bot": "Tin nhắn Bot",diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.jsonindex 094a5ef6721..c486c3775b4 100644--- a/locales/zh-CN/chat.json+++ b/locales/zh-CN/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} 项技能","agentProfile.skills_other": "{{count}} 项技能","agentSender.sourceTopic": "源话题",- "agentSignal.receipts.agentSignalLabel": "代理信号","agentSignal.receipts.memory.detail": "已保存以供未来回复使用","agentSignal.receipts.memory.openInMemory": "在记忆中打开","agentSignal.receipts.memory.title": "记忆已保存",diff --git a/locales/zh-CN/spend.json b/locales/zh-CN/spend.jsonindex 32b8ee06171..7d6cde5cece 100644--- a/locales/zh-CN/spend.json+++ b/locales/zh-CN/spend.json@@ -16,9 +16,11 @@"table.columns.spendUsd": "费用","table.columns.time": "时间","table.columns.totalTokens": "Token 使用量",+ "table.columns.trigger.agentSignal.desc": "「自进化」在后台对对话做的处理:每条消息后分析反馈、保存记忆、优化技能,以及每晚复盘。",+ "table.columns.trigger.agentSignal.openSettings": "前往「实验室 → 自进化」","table.columns.trigger.enums.agent_meta": "助手资料生成","table.columns.trigger.enums.agent_share": "助手分享",- "table.columns.trigger.enums.agent_signal": "代理信号",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API 调用","table.columns.trigger.enums.asr": "语音转写","table.columns.trigger.enums.bot": "Bot 消息",@@ -48,6 +50,7 @@"table.columns.trigger.enums.semantic_search": "知识搜索","table.columns.trigger.enums.signup_email_llm_review": "注册邮件审核","table.columns.trigger.enums.task": "任务",+ "table.columns.trigger.enums.task_callback": "任务结果跟进","table.columns.trigger.enums.thread_title": "子话题标题","table.columns.trigger.enums.topic": "话题标题(旧)","table.columns.trigger.enums.topic_analysis": "话题分析",diff --git a/locales/zh-TW/chat.json b/locales/zh-TW/chat.jsonindex 12a570add64..5310f563fb9 100644--- a/locales/zh-TW/chat.json+++ b/locales/zh-TW/chat.json@@ -47,7 +47,6 @@"agentProfile.skills_one": "{{count}} 項技能","agentProfile.skills_other": "{{count}} 項技能","agentSender.sourceTopic": "來源主題",- "agentSignal.receipts.agentSignalLabel": "代理信號","agentSignal.receipts.memory.detail": "已儲存此內容以供未來回覆使用","agentSignal.receipts.memory.openInMemory": "在記憶體中開啟","agentSignal.receipts.memory.title": "記憶已儲存",diff --git a/locales/zh-TW/spend.json b/locales/zh-TW/spend.jsonindex 11c89803e7a..8ba424d3c7a 100644--- a/locales/zh-TW/spend.json+++ b/locales/zh-TW/spend.json@@ -18,7 +18,7 @@"table.columns.totalTokens": "權杖使用量","table.columns.trigger.enums.agent_meta": "代理檔案","table.columns.trigger.enums.agent_share": "代理分享",- "table.columns.trigger.enums.agent_signal": "代理信號",+ "table.columns.trigger.enums.agent_signal": "Agent Signal","table.columns.trigger.enums.api": "API 呼叫","table.columns.trigger.enums.asr": "語音轉錄","table.columns.trigger.enums.bot": "機器人訊息",diff --git a/packages/database/src/models/__tests__/thread.test.ts b/packages/database/src/models/__tests__/thread.test.tsindex f3520676ff9..6b940f69b61 100644--- a/packages/database/src/models/__tests__/thread.test.ts+++ b/packages/database/src/models/__tests__/thread.test.ts@@ -288,6 +288,29 @@ describe('ThreadModel', () => {expect(result.map((thread) => thread.id)).toEqual(['visible-subagent-thread']);});+ it('hides sub-agent threads of a task-result wakeup from topic thread lists', async () => {+ await serverDB.transaction(async (tx) => {+ await tx.insert(threads).values({+ id: 'task-callback-subagent-thread',+ status: ThreadStatus.Active,+ title: 'Wakeup sub-agent',+ topicId,+ type: ThreadType.Isolation,+ userId,+ });+ await tx.insert(agentOperations).values({+ id: 'task-callback-subagent-operation',+ status: 'done',+ threadId: 'task-callback-subagent-thread',+ topicId,+ trigger: RequestTrigger.TaskCallback,+ userId,+ });+ });++ expect(await threadModel.queryByTopicId(topicId)).toEqual([]);+ });+it('hides marked onboarding Understanding writing threads from topic thread lists', async () => {await serverDB.insert(threads).values({id: 'understanding-thread',diff --git a/packages/database/src/models/thread.ts b/packages/database/src/models/thread.tsindex b7e8987dad6..af16cfe0b1a 100644--- a/packages/database/src/models/thread.ts+++ b/packages/database/src/models/thread.ts@@ -1,6 +1,6 @@import type { CreateThreadParams, ThreadMetadata } from '@lobechat/types';import { RequestTrigger, ThreadStatus } from '@lobechat/types';-import { and, desc, eq, isNull, notExists, sql } from 'drizzle-orm';+import { and, desc, eq, inArray, isNull, notExists, sql } from 'drizzle-orm';import type { ThreadItem } from '../schemas';import { agentOperations, messages, threads } from '../schemas';@@ -138,6 +138,8 @@ export class ThreadModel {// Internal Agent Signal and onboarding Understanding runs create// isolation threads that must stay out of the user-facing sub-agent// attachment list. Ordinary onboarding threads remain visible.+ // Sub-agents of a task-result wakeup inherit its `task_callback`+ // trigger: server-started follow-ups, kept out of the list the same way.notExists(this.db.select({ id: agentOperations.id })@@ -145,7 +147,10 @@ export class ThreadModel {.where(and(eq(agentOperations.threadId, threads.id),- eq(agentOperations.trigger, RequestTrigger.AgentSignal),+ inArray(agentOperations.trigger, [+ RequestTrigger.AgentSignal,+ RequestTrigger.TaskCallback,+ ]),),),),diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.tsindex ae53432aaa2..d781a80e5d7 100644--- a/packages/locales/src/default/chat.ts+++ b/packages/locales/src/default/chat.ts@@ -323,7 +323,6 @@ export default {'agentProfile.skills_one': '{{count}} skill','agentProfile.skills_other': '{{count}} skills','agentSender.sourceTopic': 'Source topic',- 'agentSignal.receipts.agentSignalLabel': 'Agent Signal','agentSignal.receipts.memory.detail': 'Saved this for future replies','agentSignal.receipts.memory.openInMemory': 'Open in Memory','agentSignal.receipts.memory.title': 'Memory saved',diff --git a/packages/locales/src/default/spend.ts b/packages/locales/src/default/spend.tsindex bd3025f4c64..63a343b47bd 100644--- a/packages/locales/src/default/spend.ts+++ b/packages/locales/src/default/spend.ts@@ -14,9 +14,12 @@ export default {'table.columns.spend': 'Cost','table.columns.time': 'Time','table.columns.totalTokens': 'Token usage',+ 'table.columns.trigger.agentSignal.desc':+ 'Background work Self-evolving does on conversations: reading feedback after each message, saving memories, refining skills and nightly reviews.',+ 'table.columns.trigger.agentSignal.openSettings': 'Open Labs → Self-evolving','table.columns.trigger.enums.agent_meta': 'Agent profile','table.columns.trigger.enums.agent_share': 'Agent Share',- 'table.columns.trigger.enums.agent_signal': 'Agent signal',+ 'table.columns.trigger.enums.agent_signal': 'Agent Signal','table.columns.trigger.enums.api': 'API call','table.columns.trigger.enums.asr': 'Voice transcription','table.columns.trigger.enums.bot': 'Bot message',@@ -46,6 +49,7 @@ export default {'table.columns.trigger.enums.semantic_search': 'Knowledge search','table.columns.trigger.enums.signup_email_llm_review': 'Signup email review','table.columns.trigger.enums.task': 'Task',+ 'table.columns.trigger.enums.task_callback': 'Task result follow-up','table.columns.trigger.enums.thread_title': 'Thread title','table.columns.trigger.enums.topic': 'Topic title (legacy)','table.columns.trigger.enums.topic_analysis': 'Topic analysis',diff --git a/packages/types/src/agentRuntime.ts b/packages/types/src/agentRuntime.tsindex be6dbe3d2ec..1ca81e7b9b9 100644--- a/packages/types/src/agentRuntime.ts+++ b/packages/types/src/agentRuntime.ts@@ -60,6 +60,12 @@ export enum RequestTrigger {SignupEmailLLMReview = 'signup_email_llm_review',/** Task runs and their auxiliary calls (briefs, handoff, intent, instructions). */Task = 'task',+ /**+ * The creator agent woken in its own conversation to pick up finished task+ * results (`taskResultBridge`). Server-started, but it continues the user's+ * conversation on the main spine, unlike {@link RequestTrigger.Task} runs.+ */+ TaskCallback = 'task_callback',/** Thread (sub-topic) title summaries. */ThreadTitle = 'thread_title',/**