From 7870827eaa0c2fc6b52dff468c25875485501984 Mon Sep 17 00:00:00 2001 From: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Date: Sun, 21 Jun 2026 14:29:55 +0800 Subject: [PATCH] chore(spec): drop the dead agent `memory.shortTerm` config (ADR-0013 D3, cloud#339) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `memory.shortTerm` ({maxMessages, maxTokens}) declared a working-memory window that NOTHING in the runtime ever consumed — a config that lies. Per cloud ADR-0013 D3, cross-turn grounding is done by tools reading live state and the context budget is governed by the per-request token guardrail, not by this field. The only place it was set was data-chat-agent's definition (also dead). - Remove `shortTerm` from the agent `memory` zod schema (keeping `longTerm` / `reflectionInterval` — forward-looking, off-by-default, not misleading). - Remove the dead `memory.shortTerm` declaration from data-chat-agent. - Update the memory-config spec test accordingly. No runtime behavior change (nothing read it). Public API surface unchanged (the gate tracks export names, not zod field internals); spec agent tests 45/45. Co-Authored-By: Claude Opus 4.8 --- .../service-ai/src/agents/data-chat-agent.ts | 7 ------- packages/spec/src/ai/agent.test.ts | 5 ----- packages/spec/src/ai/agent.zod.ts | 14 ++++++-------- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/packages/services/service-ai/src/agents/data-chat-agent.ts b/packages/services/service-ai/src/agents/data-chat-agent.ts index 5cb0bc8b73..37a6f0a0a7 100644 --- a/packages/services/service-ai/src/agents/data-chat-agent.ts +++ b/packages/services/service-ai/src/agents/data-chat-agent.ts @@ -96,12 +96,5 @@ Always answer in the same language the user is using. Detailed tool-usage guidan maxIterations: 10, allowReplan: true, }, - - memory: { - shortTerm: { - maxMessages: 20, - maxTokens: 4096, - }, - }, }; diff --git a/packages/spec/src/ai/agent.test.ts b/packages/spec/src/ai/agent.test.ts index 9b3b4235fa..ada2df3e5d 100644 --- a/packages/spec/src/ai/agent.test.ts +++ b/packages/spec/src/ai/agent.test.ts @@ -589,10 +589,6 @@ Be precise, data-driven, and clear in your explanations.`, role: 'Persistent Assistant', instructions: 'Remember across sessions.', memory: { - shortTerm: { - maxMessages: 100, - maxTokens: 4096, - }, longTerm: { enabled: true, store: 'vector', @@ -602,7 +598,6 @@ Be precise, data-driven, and clear in your explanations.`, }, }); - expect(agent.memory?.shortTerm?.maxMessages).toBe(100); expect(agent.memory?.longTerm?.enabled).toBe(true); expect(agent.memory?.longTerm?.store).toBe('vector'); expect(agent.memory?.reflectionInterval).toBe(5); diff --git a/packages/spec/src/ai/agent.zod.ts b/packages/spec/src/ai/agent.zod.ts index 868d651033..1fbe0d1058 100644 --- a/packages/spec/src/ai/agent.zod.ts +++ b/packages/spec/src/ai/agent.zod.ts @@ -173,14 +173,12 @@ export const AgentSchema = lazySchema(() => z.object({ /** Memory Management */ memory: z.object({ - /** Short-term (working) memory configuration */ - shortTerm: z.object({ - /** Maximum number of recent messages to retain */ - maxMessages: z.number().int().min(1).default(50).describe('Max recent messages in working memory'), - - /** Maximum token budget for short-term context */ - maxTokens: z.number().int().min(100).optional().describe('Max tokens for short-term context window'), - }).optional().describe('Short-term / working memory'), + // NOTE: `shortTerm` ({maxMessages,maxTokens}) was removed (ADR-0013 D3, + // cloud#339). It declared a working-memory window that NOTHING in the + // runtime consumed — a config that lies. Cross-turn grounding is done by + // tools reading live state, and the context budget is governed elsewhere + // (the per-request token guardrail), not by this field. `longTerm` / + // `reflectionInterval` are kept as forward-looking, off-by-default config. /** Long-term (persistent) memory configuration */ longTerm: z.object({