Skip to content

Add failing tests for #1714: agentic sync stall and opaque error handler#1716

Draft
prompt-driven-github[bot] wants to merge 1 commit into
mainfrom
fix/issue-1714
Draft

Add failing tests for #1714: agentic sync stall and opaque error handler#1716
prompt-driven-github[bot] wants to merge 1 commit into
mainfrom
fix/issue-1714

Conversation

@prompt-driven-github

Copy link
Copy Markdown
Contributor

Summary

Adds failing tests that detect the two bugs reported in #1714.

  • 43 tests total: 10 FAIL on current buggy code, 33 PASS on already-correct code
  • All 10 failures point directly at the bug locations with actionable assertion messages
  • Tests are behavioral (not source-scanning): they invoke real production functions with mocks and verify call arguments at runtime

Test Files

  • Unit test: tests/test_issue_1714_sync_stall.py

Root Cause

Bug 1 — Missing timeout= on run_agentic_task() calls:
agentic_sync_identify_modules (pdd/agentic_sync.py:2787) and its sibling agentic_sync_fix_dry_run (pdd/agentic_sync.py:2022) call run_agentic_task() without an explicit timeout= kwarg. When the provider stalls (producing only TUI spinner escape codes), the call blocks for the full DEFAULT_TIMEOUT_SECONDS = 600.0 seconds before returning success=False — confirmed by the session log showing exactly 600.06 s. Same omission exists in agentic_fix.py, agentic_crash.py, agentic_verify.py, agentic_update.py, agentic_test_generate.py, and update_main.py.

Bug 2 — Opaque except Exception handler in sync_main.py:1297:
The per-language exception handler catches all Exceptions but does NOT call record_core_dump_error(), causing pdd_cloud to surface an opaque "An unexpected error occurred during sync" with no exception type, stage name, or traceback. The correct pattern already exists at sync_main.py:821 (budget-exhaustion handler).

What This PR Contains

  • Failing unit tests that reproduce both reported bugs
  • Tests verified to fail on current code and will pass once the bugs are fixed
  • No production code changes — this is a test-only PR to document the bugs

Next Steps

  1. Fix Bug 1: Add timeout= kwarg to run_agentic_task() calls in pdd/agentic_sync.py:2787, pdd/agentic_sync.py:2022, and siblings (agentic_fix.py, agentic_crash.py, agentic_verify.py, agentic_update.py, agentic_test_generate.py, update_main.py)
  2. Fix Bug 2: Add record_core_dump_error() call with exception type, stage, and traceback to pdd/sync_main.py:1297; surface type(e).__name__ in default rprint output
  3. Verify all 43 unit tests pass with the fix: pytest -vv tests/test_issue_1714_sync_stall.py
  4. Run full test suite to check for regressions: pytest -vv tests/
  5. Mark PR as ready for review

Fixes #1714


Generated by PDD agentic bug workflow

…r handler

Tests verify two bugs in `pdd sync`:
1. `agentic_sync_identify_modules` (and siblings) call `run_agentic_task()`
   without an explicit `timeout=` kwarg, allowing a silent spinner stall
   to burn the full DEFAULT_TIMEOUT_SECONDS (600 s) before failing.
2. `sync_main.py:1297` broad `except Exception` handler omits
   `record_core_dump_error()`, causing pdd_cloud to surface an opaque
   "An unexpected error occurred during sync" with no diagnostics.

43 tests: 10 FAIL on current buggy code, 33 PASS on already-correct code.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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.

bug(sync): agentic_sync_identify_modules hangs to 600s timeout then sync dies with 'unexpected error' / core_dump (exit 1)

1 participant