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 — storage: shared `event` table grows unbounded; retention prune never reclaims disk space · Issue #56827 · anomalyco/opencode

storage: shared event table grows unbounded; retention prune never reclaims disk space #56827

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
storage: shared event table grows unbounded; retention prune never reclaims disk space#56827
Copy link
Labels
pending closetriaging

Description

@Amperstrand
Amperstrand
opened on Oct 18, 2026
Issue body actions

Environment

opencode v1.19.0, Linux x86_64, ~10 concurrent long-lived opencode instances sharing one ~/.local/share/opencode/opencode.db (SQLite WAL), uptime of instances: days.

What happened

The append-only event table (event-sourcing of all session state changes across all instances) grew to 9.8 GB — 76% of a 12.85 GB database over ~2 weeks, despite cleanup prune=7.days running hourly.

Key observations from forensics on the resulting database:

  • DELETE-based retention never shrinks the file (no auto_vacuum / VACUUM), so the file only grows.
  • With N long-lived reader connections, WAL auto-checkpoint is starved (0.8 GB WAL observed alongside the main file).
  • Pruning a multi-GB B-tree produces sustained ~100+ MB/s of page-churn writes from whichever instance holds the writer lock — for a HIL bench host this looked like a runaway process and ultimately filled the root filesystem.
  • After disk-full (ENOSPC mid-transaction) the table scanned as empty while still occupying 9.8 GB of live pages (not on the freelist) — the delete/rollback sequence orphaned the pages.

Ask

  • Incremental vacuum (or post-prune reclaim) for retention paths.
  • Per-table retention/size bounds for event.
  • A WAL checkpoint strategy that survives long-lived multi-instance readers.

Happy to provide more forensic detail (page footprints, WAL frame data, log timelines).

Activity

  1. opencode-agent commented on Oct 18, 2026

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

    Thanks for the detailed forensics, @Amperstrand.

    This report is about opencode v1.19.0. v1 now only gets fixes for critical bugs (data loss, security, or breakage with no workaround), so this is unlikely to be changed in v1. Until then, you can get the space back by stopping all instances and running sqlite3 ~/.local/share/opencode/opencode.db 'PRAGMA wal_checkpoint(TRUNCATE); VACUUM;'. Make sure there's enough free disk for the copy VACUUM writes.

    Work happens on v2 (@opencode/cli), and we'd encourage you to upgrade. Related v2 work:

    • Unbounded growth of the event table: opencode.db reaches 13GB+, mostly message.updated.1 snapshots (no retention/compaction) #33356: open v2 issue about the same unbounded event table growth
    • EventV2 cold history duplicates large snapshot payloads and amplifies SQLite storage/reads #47854: v2 event history duplicating large snapshot payloads
    • refactor(core): enable incremental auto-vacuum before WAL initialization #56365: open PR that turns on incremental auto-vacuum for new databases

    Earlier v1 reports of the same thing were #47223 and #53760.

    If you see the same growth, or the starved WAL checkpoints with many instances, on v2, or you think this is critical on v1, please reply here with the details.

  2. opencode-agent
    added
    pending close
    triaging
    on Oct 18, 2026
  3. opencode-agent
    closed this as not plannedon Oct 19, 2026
  4. opencode-agent commented on Oct 19, 2026

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

    We haven't heard back, so I'm closing this as not planned. The report is about opencode v1.19.0, and v1 now only gets fixes for critical bugs. Unbounded event table growth is a known problem: v2 tracks it in #33356, and #56365 proposes incremental auto-vacuum. Until then, stopping all instances and running PRAGMA wal_checkpoint(TRUNCATE); VACUUM; gets the space back.

    Thanks again for the detailed forensics. If you see the same growth or the starved WAL checkpoints on v2 (@opencode/cli), please reply with the version and details and we can reopen.

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

    pending closetriaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — 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.