Problem
get_pr_status was fixed in PR #580 to use try/finally: await client.close(), but five other endpoints in codeframe/ui/routers/pr_v2.py still allocate an httpx.AsyncClient on every request and never close it:
list_pull_requests (~line 250)
get_pull_request (~line 290)
create_pull_request (~line 333)
merge_pull_request (~line 380)
close_pull_request (~line 431)
Under load these will accumulate open sockets/file descriptors.
Fix
Apply the same try/finally: await client.close() pattern to each of the five endpoints. The pattern is already established in get_pr_status.
Notes
Problem
get_pr_statuswas fixed in PR #580 to usetry/finally: await client.close(), but five other endpoints incodeframe/ui/routers/pr_v2.pystill allocate anhttpx.AsyncClienton every request and never close it:list_pull_requests(~line 250)get_pull_request(~line 290)create_pull_request(~line 333)merge_pull_request(~line 380)close_pull_request(~line 431)Under load these will accumulate open sockets/file descriptors.
Fix
Apply the same
try/finally: await client.close()pattern to each of the five endpoints. The pattern is already established inget_pr_status.Notes