Skip to content

get_code_context refetches from GitHub on every call — add a cache #73

Description

@GoodbyePlanet

Impact: Medium (performance)

`server/tools/search.py:198-202` calls `fetch_file_content`, which opens a fresh HTTP client (`server/indexer/github_source.py:386`) on every invocation. The same file requested multiple times in a session hits the GitHub API each time.

Recommended change

The index already stores the blob SHA per file — add an LRU/TTL cache keyed on the blob SHA so repeated context fetches are served locally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions