Skip to content

fix(record): retry unparsable L1 extraction output#254

Open
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/l1-extraction-parse-retry-clean
Open

fix(record): retry unparsable L1 extraction output#254
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/l1-extraction-parse-retry-clean

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Description | 描述

Retry L1 extraction once when the model returns output that cannot be parsed as the required JSON scene array.

This addresses the L1 parse-failure part of seed data loss in #115. Non-OpenAI-compatible models can produce structurally invalid JSON; previously parseExtractionResult() returned [], so the batch ended as extracted=0, stored=0 with no second attempt.

This PR:

  • distinguishes parse failures from a valid empty extraction array
  • retries exactly once on parse failure with a stricter JSON-only system instruction
  • keeps valid [] responses as-is and does not retry them
  • reuses the same runner instance on the CleanContextRunner path
  • adds focused regression coverage for retry success and valid-empty no-retry behavior

Related Issue | 关联 Issue

Fixes #115

Verification | 验证

  • RED: npm test -- src/core/record/l1-extractor-retry.test.ts failed because only l1-extraction ran once
  • GREEN: npm test -- src/core/record/l1-extractor-retry.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: seed command fails silently — L1 extraction JSON parse errors, L2/L3 timer conflicts, no retry

2 participants