Skip to content

[FEATURE]: Desktop client should provide cache management and cleanup settings #29037

Description

@JinkaiNiu

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

opencode generates various cache files under ~/.local/share/opencode/ during normal operation. The tool-output/ directory, which stores raw output from tools like WebFetch (HTML, JS, cookies, etc.), can grow to 20GB+ over time with no automatic cleanup mechanism.

Currently, compaction settings (compaction.prune) only manage in-memory context/token compression and do not affect on-disk cache files. Users must manually rm -rf these directories.

Suggested solution:

Add a cache management page in the Desktop client's Settings/Preferences with:

  1. Cache overview — list cache categories and their current disk usage:

    • tool-output/ — tool output cache (WebFetch, etc.)
    • log/ — log files
    • repos/ — cloned repositories
    • storage/ — session storage data
    • Session/prompt history
  2. Cleanup actions:

    • One-click "Clear" button per category or "Clear All"
    • Auto-cleanup policies (e.g., on exit / by size threshold / by age)
  3. Storage limit — configurable maximum cache size; auto-clean oldest data when exceeded

Benefits:

  • Prevents unbounded disk usage without user awareness
  • Improves desktop client user experience
  • Aligns with common IDE conventions (e.g., VSCode's built-in cache management)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions