Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Resuming a legacy breakpoint snapshot crashes with IndexError when the paused component has an empty input socket

Đang mở Phù hợp với người mới
#13,486 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, testing

Hướng nghiên cứu

Đọc _consume_component_inputs trong haystack/core/pipeline/base.py quanh dòng 1357 và phần kiểm thử snapshot cũ trong test/core/pipeline/test_breakpoint.py, đặc biệt là TestResumeFromLegacyPipelineSnapshot. Tái hiện trường hợp socket tùy chọn bị bỏ sót, sau đó thêm một kiểm thử hồi quy cho thấy snapshot cũ tiếp tục chạy với giá trị mặc định của socket ({'greeter': {'result': 'hi'}}) và xác nhận các kiểm thử breakpoint chạy thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug

Resuming a breakpoint snapshot saved by an older Haystack (legacy inputs_format=None, flattened inputs) crashes with IndexError: list index out of range when the paused component has an input socket with no stored value. This happens for a component with all-optional inputs triggered with no input, or any optional socket omitted from the snapshot. Current-format snapshots resume correctly.

Error message

IndexError: list index out of range
  at haystack/core/pipeline/base.py:1357 in _consume_component_inputs (is_resume branch)

is_resume indexes socket_inputs_values[0] without checking the list is non-empty.

Expected behavior

The component resumes with its socket default: {'greeter': {'result': 'hi'}}.

To Reproduce

A pipeline with a component whose only input is optional (greeting: str = "hi") is run with break_point=Breakpoint(component_name="greeter"); the snapshot is converted to the legacy format (inputs_format=None, flattened inputs via the same helpers the migration uses) and resumed:

Case A (all-optional component, no inputs) legacy snapshot inputs: {'greeter': {}}
Case A FAILED: IndexError : list index out of range
Case B (current-format snapshot) resume: {'greeter': {'result': 'hi'}}

A self-contained script (repro_legacy_variants.py, plus a second shape repro_legacy_optional.py) is available; happy to attach it.

Additional context

  • Legacy snapshot resume is explicitly supported (haystack/core/pipeline/breakpoint.py:60-70, the fix-pipeline-snapshot-resume-in-loops release note, and TestResumeFromLegacyPipelineSnapshot), but no test covers a missing socket value.
  • Suggested fix: guard the index (if socket_inputs_values:) and add a legacy-resume test with an omitted optional socket; verified locally that this fixes both repro shapes and test/core/pipeline/test_breakpoint.py stays green (41 passed).
  • Searched open and closed issues/PRs for breakpoint/snapshot/legacy resume IndexError: no duplicate. Open PR #13415 touches _consume_component_inputs but only adds lazy-variadic sorting, not this branch.

System

  • OS: Windows 11
  • Haystack version: 4b5dd70 (main, v3.5.0-rc0)

Reported with AI assistance (Claude); the reproduction was executed and verified locally.

Ngôn ngữ chính
Python
Star
26.8k
Fork
3.3k
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
235

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của deepset-ai/haystack

Tất cả issue của deepset-ai/haystack

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.