fix(algorithm): harden chart generation against per-subsection failures - #16
Open
QingCheng24 wants to merge 1 commit into
Open
Conversation
|
Hi @QingCheng24, thanks for your contribution! This pull request is currently waiting for the CLA Assistant check to pass before the CI process can continue. Please follow the signing link shown by CLA Assistant on this PR. If you have already signed the CLA but the check is still failing, please make sure that all email addresses used in your commits are added to and verified on your GitHub account. After updating your email settings or signing the CLA, please click Recheck in the CLA Assistant comment/check so the status can be refreshed. Once the CLA Assistant check passes, CI will continue automatically. |
Prevent a single failing H2 subsection from crashing an entire H1 section
during chart-task generation:
- _process_section_h2 now returns [] on its exception path instead of
falling off the end and returning None.
- _process_section_h1 skips any non-list gather result (None, or an
Exception surfaced by return_exceptions=True) before extend(), avoiding
a TypeError that turned a recoverable per-subsection error into a full
section crash.
Also fix a latent regex bug in _remove_reference_section: the boundary
pattern was built with an f-string, so `#{1, 6}` was interpolated as the
tuple (1, 6) instead of the quantifier `#{1,6}`. Behavior is unchanged
today (the match end is not used by the current slicing), but the regex
now means what it reads; this removes a trap for future edits.
Adds regression tests for the chart H1/H2 error handling.
QingCheng24
force-pushed
the
fix/algorithm-report-chart-robustness
branch
from
August 7, 2026 12:36
479bd6a to
9ad7f84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paired: GitHub #16 ↔ GitCode !323
What type of PR is this?
/kind
What does this PR do / why do we need it:
_process_section_h2now returns[]on its exception path instead of falling off the end and returningNone._process_section_h1skips any non-listgatherresult (None, or anExceptionsurfaced byreturn_exceptions=True) beforeextend(), avoiding aTypeErrorthat turned a recoverable per-subsection error into a full-section crash._remove_reference_section: the boundary pattern was built with an f-string, so#{1, 6}was interpolated as the tuple(1, 6)instead of the quantifier#{1,6}. Behavior is unchanged today (the match end is not used by the current slicing), but the regex now means what it reads; this removes a trap for future edits.Which issue(s) this PR fixes:
N/A (no tracked issue)
What scenarios were tested, and what were the verification results (Function, performance, reliability, etc.):
tests/algorithm/chart_generation/test_figure_placeholders_h1_resilience.py:test_process_section_h2_returns_empty_list_on_llm_error: a failingcall_modelyields[], neverNone.test_process_section_h1_skips_none_and_exception_results: with subsection results[good_task, None, RuntimeError], aggregation returns only the good task (chart_id_in_section=1) and does not raiseTypeError.gather(return_exceptions=True), propagated an Exception object downstream); after the fix, failed subsections are skipped and remaining charts are still generated.pytest tests/algorithm/chart_generation tests/source_tracer-> 55 passed.test_simple_react_telemetry_uses_built_tool_map, confirmed failing on cleanmain, unrelated to this PR).python -m compileall openjiuwen_deepsearch server-> clean.Self-checklist: