Skip to content

fix(checkpoint): remove stray diff marker in RecalibrateSources inter…#393

Open
zzzbbbxxx123 wants to merge 1 commit into
TencentCloud:mainfrom
zzzbbbxxx123:count_error_fix
Open

fix(checkpoint): remove stray diff marker in RecalibrateSources inter…#393
zzzbbbxxx123 wants to merge 1 commit into
TencentCloud:mainfrom
zzzbbbxxx123:count_error_fix

Conversation

@zzzbbbxxx123

Copy link
Copy Markdown

Description | 描述

修复 src/utils/checkpoint.tsRecalibrateSources 接口的语法错误:第 154 行残留了一个 git diff 标记符 +,导致 vectorStore 属性无法被 TypeScript 识别。这使得已实现的
recalibrate() 方法在类型检查时报错,无法正确从 VectorStore 读取 L1 记录数作为校准基准。

修改内容:

  • checkpoint.ts:删除第 154 行开头的 + 残留字符,恢复接口正确定义
  • checkpoint.test.ts:新增 5 个测试用例覆盖 recalibrate、JSONL 计数、VectorStore 降级等场景
  • tdai-core.ts:在 scheduler 启动前调用 checkpoint.recalibrate() 实现启动时自动校准

修复后,recalibrate() 在 Gateway 启动时自动执行,从实际 JSONL 数据/VectorStore 重新统计 L1 记录数和 L0 对话轮次,修正 total_memories_extractedl0_conversations_count
memories_since_last_persona 的漂移值,确保状态上报和 Persona 触发阈值基于真实数据。

Related Issue | 关联 Issue

Fix #157

Change Type | 修改类型

  • Bug fix | Bug 修复

Self-test Checklist | 自测清单

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

Additional Notes | 其他说明

全部 72 个测试用例通过(含新增 5 个 checkpoint 测试):

Test Files 5 passed (5)
Tests 72 passed (72)

…face

The stray '+' character at the start of line 154 (a leftover git diff
marker) broke the RecalibrateSources interface definition, preventing
vectorStore from being recognized as a valid property. This caused the
recalibrate() method to fail type-checking and prevented the checkpoint
recalibration logic from accessing the vector store as source of truth.

Removing the '+' restores the interface to its intended definition,
allowing the recalibrate() method (already implemented) to correctly
recount L1 records and L0 conversations from actual on-disk data,
fixing the counter drift issue after cleanup operations.

Closes TencentCloud#157
Signed-off-by: zzz <zzz@users.noreply.github.com>
Signed-off-by: zzz <zzz_h7@foxmail.com>
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thank you for submitting this PR and participating in Tencent Rhino-bird Open-source Training Program!
We have successfully received your submission. The program is currently in full swing, and we will complete the Code Review for you as soon as possible. Please keep an eye on the status notifications for this PR so you can follow up promptly once the review feedback is provided.
Thanks again for your contribution and open-source spirit! 🚀

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.

[good first issue]🎯 fix(data): checkpoint counters never decrease — drift from actual data after cleanup

2 participants