Skip to content

fix(server): add requests dependency and fix cache lock race condition#25

Merged
mberlofa merged 1 commit into
mainfrom
fix/add-requests-and-cache-safety
Apr 6, 2026
Merged

fix(server): add requests dependency and fix cache lock race condition#25
mberlofa merged 1 commit into
mainfrom
fix/add-requests-and-cache-safety

Conversation

@mberlofa

@mberlofa mberlofa commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add requests>=2.31 to requirements.txt so tool packages (github, http, notifications) that depend on it work at runtime without needing EXTRA_PIP_PACKAGES
  • Fix thread-unsafe pattern in caching._get_cached() where _locks.get(tool_name, threading.Lock()) created a new ephemeral lock on each miss, allowing concurrent threads to bypass mutual exclusion

Test plan

  • 110/110 pytest tests passing
  • Python syntax validation
  • Deploy and verify get_file / create_pr tools work without EXTRA_PIP_PACKAGES

Add requests>=2.31 to requirements.txt so tool packages that depend on
it (github, http, notifications) work at runtime without requiring
EXTRA_PIP_PACKAGES.

Fix thread-unsafe pattern in caching._get_cached() where
_locks.get(tool_name, threading.Lock()) created a new ephemeral lock
on each call when the key was missing, allowing concurrent threads to
bypass mutual exclusion.
@mberlofa mberlofa merged commit a1176df into main Apr 6, 2026
4 checks passed
@mberlofa mberlofa deleted the fix/add-requests-and-cache-safety branch April 6, 2026 18:10
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