Skip to content

Commit 7870827

Browse files
os-zhuangclaude
andcommitted
chore(spec): drop the dead agent memory.shortTerm config (ADR-0013 D3, cloud#339)
`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 <noreply@anthropic.com>
1 parent 8545176 commit 7870827

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

packages/services/service-ai/src/agents/data-chat-agent.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,5 @@ Always answer in the same language the user is using. Detailed tool-usage guidan
9696
maxIterations: 10,
9797
allowReplan: true,
9898
},
99-
100-
memory: {
101-
shortTerm: {
102-
maxMessages: 20,
103-
maxTokens: 4096,
104-
},
105-
},
10699
};
107100

packages/spec/src/ai/agent.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,6 @@ Be precise, data-driven, and clear in your explanations.`,
589589
role: 'Persistent Assistant',
590590
instructions: 'Remember across sessions.',
591591
memory: {
592-
shortTerm: {
593-
maxMessages: 100,
594-
maxTokens: 4096,
595-
},
596592
longTerm: {
597593
enabled: true,
598594
store: 'vector',
@@ -602,7 +598,6 @@ Be precise, data-driven, and clear in your explanations.`,
602598
},
603599
});
604600

605-
expect(agent.memory?.shortTerm?.maxMessages).toBe(100);
606601
expect(agent.memory?.longTerm?.enabled).toBe(true);
607602
expect(agent.memory?.longTerm?.store).toBe('vector');
608603
expect(agent.memory?.reflectionInterval).toBe(5);

packages/spec/src/ai/agent.zod.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,12 @@ export const AgentSchema = lazySchema(() => z.object({
173173

174174
/** Memory Management */
175175
memory: z.object({
176-
/** Short-term (working) memory configuration */
177-
shortTerm: z.object({
178-
/** Maximum number of recent messages to retain */
179-
maxMessages: z.number().int().min(1).default(50).describe('Max recent messages in working memory'),
180-
181-
/** Maximum token budget for short-term context */
182-
maxTokens: z.number().int().min(100).optional().describe('Max tokens for short-term context window'),
183-
}).optional().describe('Short-term / working memory'),
176+
// NOTE: `shortTerm` ({maxMessages,maxTokens}) was removed (ADR-0013 D3,
177+
// cloud#339). It declared a working-memory window that NOTHING in the
178+
// runtime consumed — a config that lies. Cross-turn grounding is done by
179+
// tools reading live state, and the context budget is governed elsewhere
180+
// (the per-request token guardrail), not by this field. `longTerm` /
181+
// `reflectionInterval` are kept as forward-looking, off-by-default config.
184182

185183
/** Long-term (persistent) memory configuration */
186184
longTerm: z.object({

0 commit comments

Comments
 (0)