Repository navigation
fix(analysis-run): map a mid-reconstruction provider failure to an actionable 503 #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -733,9 +733,24 @@ async def _deliver_lineage_reconstruction( | |
| f"channels ({', '.join(sorted(active_channels))}). Run " | ||
| "scripts/estimate_channel_weights.py, then start this run again.", | ||
| ) | ||
| edges = lineage_edge_specs( | ||
| records_from_source_posts(rows), llm=adjudication_client, weights=weights | ||
| ) | ||
| try: | ||
| edges = lineage_edge_specs( | ||
| records_from_source_posts(rows), llm=adjudication_client, weights=weights | ||
| ) | ||
| except (HttpClientError, OSError, ValueError, TypeError) as exc: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Catch list covers all provider-boundary errors Every failure from Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| # Only the llm channel talks to a provider mid-reconstruction; a | ||
| # deterministic run hitting this would be a code bug worth the | ||
| # crash. The enclosing transaction rolls back, so no partial | ||
| # graph persists (issue #289 RED 4/6) and the run stays | ||
| # startable once the provider recovers. | ||
| if "llm" not in active_channels: | ||
| raise | ||
| raise AnalysisRunStartError( | ||
| 503, | ||
| "The adjudication provider failed mid-reconstruction; nothing " | ||
| "was persisted. Check the contextual-orchestrator transport, " | ||
| "then start this run again.", | ||
| ) from exc | ||
|
Comment on lines
+740
to
+753
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Real reconstruction bugs disguised as retryable provider outages On an llm-inclusive run, the Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed — fixed in the follow-up PR: the conversion now happens only inside judge() via a _ProviderBoundaryAdjudication wrapper that raises a typed _AdjudicationProviderError; the delivery catches only that type, so a stray ValueError/TypeError from our own reconstruction code crashes loudly again on llm runs too. |
||
| digest = reconstruction_result_digest(edges) | ||
| finished = datetime.now(timezone.utc) | ||
| if finished < now: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Info: Rollback of partial graph is guaranteed by both callers
The
no partial graph persistsclaim holds: the HTTP path (main.py:3617) and the worker (analysis_run_worker.py:56) both wrap delivery inconn.transaction()and handleAnalysisRunStartError, so the 503 raised before any insert rolls back.Was this helpful? React with 👍 or 👎 to provide feedback.