GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Database always increasing its size · Issue #58124 · anomalyco/opencode

Database always increasing its size #58124

New issue
Copy link
New issue
Copy link
Open
Open
Database always increasing its size#58124
Copy link

Description

@leonel-mona
leonel-mona
opened on Oct 22, 2026
Issue body actions

When using opencode for really long sessions its database in .local\share\opencode just keeps growing.
So, maybe a solution could be to let the history be as long as the last 2 compacts plus the actual chat

Reacted by Michał Wielgosz and Richard Ziegler

Activity

  1. opencode-agent commented on Oct 22, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 22, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the suggestion, @leonel-mona!

    If I understand correctly, you'd like OpenCode to stop the local database (~/.local/share/opencode) from growing without limit during very long sessions. You suggest only keeping history from the last two compactions plus the current conversation, and deleting older messages.

    OpenCode currently keeps the full session history, so steady growth is expected. A retention or pruning option would be a new feature, so I've marked this as a feature request for the maintainers to consider.

    It would help to know which version you're on (opencode --version) and roughly how large the database gets. Note that only critical fixes go into 1.x, so new features like this would land in 2.x.

  2. leonel-mona commented on Oct 22, 2026

    @leonel-mona
    leonel-mona
    on Oct 22, 2026
    Author
    More actions

    Exactly, my version is 1.19.4. I ended up with a 30GB database. I think it can be a critical fix, because opencode just says "Failed to fetch" without checking the logs, someone could think that it just doesnt work.

  3. Dante-dan commented on Oct 23, 2026

    @Dante-dan
    Dante-dan
    on Oct 23, 2026
    Contributor
    More actions

    The active-session case here is distinct from #57882, which expires whole inactive sessions, and #56365, which reclaims free SQLite pages. #16101 already discusses general storage statistics and lifecycle tooling; I would keep those out of a separate patch here.

    For the two-compaction window, I suggest an opt-in, per-session retention preview as the first increment:

    • Start at the second-newest completed compaction, retaining the subsequent conversation; failed/running compactions do not advance the boundary.
    • Expand the retained set for metadata.keepID references. Current summaries reconstruct recent text from older message rows, so those rows cannot simply be deleted.
    • Preserve the history needed for native-compaction fallback. A model switch or undecodable native window can require the original transcript back to a local summary. For native-only histories, the preview should report that a safe two-checkpoint bound is unavailable rather than propose dropping that fallback.

    These dependencies are visible in the history reader at 8482dbf. The preview would show the resulting boundary and why extra rows remain; it would perform no deletion. Existing retention would remain unchanged by default.

    A later explicit apply operation would need agreed archive/history-loss semantics: exports include the settled transcript, and old fork/revert boundaries would no longer be available after deleting their messages. Validation would cover repeated/failed compactions, keepID, native model switching, legacy schemas, and export/fork/revert behavior.

    Would maintainers approve this checkpoint-retention preview scope? This is source analysis of the development tree, not a diagnosis of the reported v1.19.4 30 GB database or its “Failed to fetch” error.

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

Metadata

Metadata

Assignees

No one assigned

    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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.