Skip to content

Fix report fallback chain broken by broad try/except#173

Merged
neoneye merged 1 commit into
mainfrom
mcp-file-info-report-empty2
Mar 7, 2026
Merged

Fix report fallback chain broken by broad try/except#173
neoneye merged 1 commit into
mainfrom
mcp-file-info-report-empty2

Conversation

@neoneye

@neoneye neoneye commented Mar 7, 2026

Copy link
Copy Markdown
Member

Summary

  • plan_file_info with artifact=report returned empty on production because fetch_artifact_from_worker_plan wrapped HTTP + DB + zip fallbacks in a single try/except Exception — a worker connection error skipped the DB and zip snapshot fallbacks entirely
  • Extract the report path into _fetch_report_with_fallbacks() with three isolated try/except blocks so each failure logs at warning level and falls through to the next step
  • Add 5 test cases covering the fallback chain (ConnectError, TimeoutException, all-fail, HTTP 200, HTTP 500)

Test plan

  • pytest mcp_cloud/tests/test_worker_fetchers.py — 5 new tests pass
  • pytest mcp_cloud/tests/test_plan_file_info_tool.py — 14 existing tests still pass
  • Deploy to staging and verify plan_file_info(artifact="report") returns report when worker is unreachable but DB/zip has data

🤖 Generated with Claude Code

…t_from_worker_plan

The report path wrapped HTTP + DB + zip fallbacks in a single try/except,
so a worker connection error (ConnectError, TimeoutException) returned None
and skipped the DB and zip snapshot fallbacks entirely. Extract the report
path into _fetch_report_with_fallbacks() with three isolated try/except
blocks—one per fallback step—so each failure logs and falls through.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@neoneye neoneye merged commit 3f5061f into main Mar 7, 2026
3 checks passed
@neoneye neoneye deleted the mcp-file-info-report-empty2 branch March 7, 2026 16:19
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.

1 participant