Skip to content

fix(record): persist L1 extraction failure diagnostics#252

Open
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/l1-extraction-failure-diagnostics
Open

fix(record): persist L1 extraction failure diagnostics#252
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/l1-extraction-failure-diagnostics

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description | 描述

Persist L1 extraction failure diagnostics when the extraction model returns empty output, content-filter prose, or malformed JSON instead of the expected scene array.

Before this change, parseExtractionResult() returned an empty array for these failures and the pipeline reported extracted=0, leaving operators with no durable evidence of what the model actually returned. This matches the failure mode in #104, where content filtering made L1 appear to silently stop.

This PR:

  • records failed L1 extraction parses to .metadata/l1-extraction-failures.jsonl
  • includes failure reason/message, session identifiers, model, source message ids, previous scene, raw response length, truncation flag, and a capped raw response
  • preserves existing extraction semantics: parse failures still return zero scenes/memories and do not block the pipeline
  • adds focused regression coverage using a content-filter style model response

Related Issue | 关联 Issue

Fixes #104

Verification | 验证

  • RED: npm test -- src/core/record/l1-extractor-diagnostics.test.ts failed with missing diagnostics file
  • GREEN: npm test -- src/core/record/l1-extractor-diagnostics.test.ts
  • npm test
  • npm run build

Signed-off-by: 李冠辰 <liguanchen@xiaomi.com>
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

@YOMXXX 4 PRs in one day tackling L1 extraction robustness — JSON parsing tolerance, dedup hardening, failure diagnostics persistence, and auto-retry. Great coverage! We'll review them one by one 🚀

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.

[Bug] 主代理触发平台风控后tdai卡在无法进行

2 participants