Skip to content

refile recently modified files at the tail of the gptel-context #1112

@aagit

Description

@aagit

Whenever I edit a file that is located at the start of the gptel context that invalidates potentially all kvcache.

Statistically there's significant locality on the files I modify most frequently.

I wish whenever a file added with gptel-add-file is updated on disk (either because it was modified and saved to disk by the editor, and also because its buffer was invalidated after a tool like ripgrep-edit modified the file from outside the editor) the location of the file in the gptel context should be moved to the bottom of context, so as I keep editing it repeteadly, it will invalidate the "whole" kvcache at most once.

Describe the solution you'd like
I guess I could try to achieve it from outside gptel too, but I don't know if there's enough visibility into the gptel-context to achieve this...

I think it could be the default behavior considering currently gptel doesn't guarantee any order in the context.

Describe alternatives you've considered
I don't think there's any alternatives to avoid recomputing all kvcache every time I update (or invalidate) a file in-gptel-context.

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