Skip to content

test(recall): cover character budget guards#203

Open
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/recall-character-budget
Open

test(recall): cover character budget guards#203
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/recall-character-budget

Conversation

@RerankerGuo

Copy link
Copy Markdown

Description | 描述

Add focused regression coverage for the recall-time L1 character budget safeguards.

Latest main already includes recall.maxCharsPerMemory, recall.maxTotalRecallChars, and recall-time budget application. This PR protects that behavior with tests for:

  • parsing the new recall budget config defaults and custom values
  • truncating an oversized recalled L1 memory before injection
  • stopping injected L1 memories once the total recall budget is exhausted

This keeps the PR deliberately narrow and avoids schema/status/supersede changes from the broader issue.

Related Issue | 关联 Issue

Related to #70

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Additional Notes | 其他说明

Verified with npx vitest run src/config.test.ts src/core/hooks/auto-recall.test.ts, npm test, and npm run build using Node v24.15.0.

Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Good to see regression coverage for the recall character budget guards. Protecting the new budget behavior with tests helps prevent future breaks. We'll review it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants