Skip to content

fix(ingest): keep discovering Codex rollouts after an invalid record - #7656

Open
123XieC wants to merge 1 commit into
volcengine:mainfrom
123XieC:fix/ingest-codex-skip-invalid-metadata-records
Open

123XieC wants to merge 1 commit into
volcengine:mainfrom
123XieC:fix/ingest-codex-skip-invalid-metadata-records

Conversation

@123XieC

@123XieC 123XieC commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Description

A corrupt record near the start of one Codex rollout can cause the entire source discovery pass to fail, including unrelated sessions. A malformed JSON line can also hide the native session ID and provider even when a valid session_meta record follows.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Fixes #7655

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Changes Made

  • Skip malformed JSON and records of the wrong shape while looking for the first object-shaped session_meta payload. This matches the incremental reader's per-record recovery.
  • Keep the existing fallback when there is no readable metadata. A test exercises discovery of two files and reads the first file's assistant message with the recovered provider.

Testing

  • Regression tests added. The incomplete JSON, JSON array, and scalar metadata payload cases all fail on the base. Existing clean and forked rollouts pass on the base.
  • python -m pytest -o addopts='' -q tests/ingest — 40 passed on macOS with Python 3.12.16. No live model or server calls.
  • ruff check, ruff format --check, and git diff --check pass for the changes.

Checklist

  • Code style and diff reviewed.

This branch has not been deployed

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Bug]: Invalid records can abort Codex rollout discovery

1 participant