Skip to content

Vacuum OpenCode database before serving - #21

Merged
laurenceputra merged 3 commits into
mainfrom
feat/startup-vacuum-serve
Sep 13, 2026
Merged

laurenceputra merged 3 commits into
mainfrom
feat/startup-vacuum-serve

Conversation

@laurenceputra

Copy link
Copy Markdown
Owner

Summary

  • switch container launches from opencode web to opencode serve
  • vacuum an existing persisted SQLite database as the mapped runtime user before startup, with lock and wall-clock bounds plus warning-only failures
  • add SQLite/runtime smoke coverage, documentation, and release metadata for version 0.3.0

Validation

  • bash tests/run.sh
  • bash -n .opencode_web_yolo.sh .opencode_web_yolo_config.sh .opencode_web_yolo_entrypoint.sh .opencode_web_yolo_runtime.sh install.sh tests/*.sh
  • git diff --check
  • Docker and ShellCheck validation are configured in CI; those tools were unavailable locally

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The reworked version guard relies on git merge-base that is unavailable under the CI job's fetch-depth: 2, causing the drift check to silently skip on typical PR merge refs.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR switches container launches from opencode web to opencode serve and adds a best-effort startup SQLite VACUUM of a persisted OpenCode database (run as the mapped user via gosu, bounded by a busy timeout and a GNU timeout TERM/KILL escalation, with warning-only failure handling). It also updates the runtime image, docs, skills, tests, CI, and release metadata for version 0.3.0. It fits into the wrapper's existing entrypoint/runtime contract, adding a maintenance step that is explicitly kept separate from the API-only retention worker.

Changes:

  • Replace the launch command with opencode serve across the wrapper, entrypoint smoke checks, docs, and skills.
  • Add startup VACUUM maintenance in the entrypoint plus sqlite3 in the runtime image, with new unit tests and CI (real VACUUM + authenticated opencode serve smoke test).
  • Rework tests/version_guard.sh to handle merge commits, add tests/test_version_guard.sh, and bump VERSION/CHANGELOG.md to 0.3.0.
File summaries
File Description
VERSION Bumps release to 0.3.0.
CHANGELOG.md Documents 0.3.0 changes (serve switch, startup VACUUM, sqlite3).
.opencode_web_yolo.sh Switches app command and dry-run output to opencode serve.
.opencode_web_yolo.Dockerfile Installs sqlite3 in the runtime image.
.opencode_web_yolo_entrypoint.sh Adds gated startup VACUUM with timeout/kill escalation and warning-only failures.
.github/workflows/ci.yml Adds syntax/shellcheck entries, real VACUUM validation, and an authenticated serve smoke test.
tests/test_startup_vacuum.sh New coverage for existing/missing DB, failure, and timeout paths.
tests/version_guard.sh Reworks drift guard to compute a comparison base for merge commits.
tests/test_version_guard.sh New tests for normal, merge, and shallow-clone guard behavior.
tests/test_entrypoint_instruction_flag.sh Updates assertion to opencode serve.
tests/test_dry_run.sh Asserts opencode serve and absence of opencode web.
tests/run.sh Registers the two new test scripts.
README.md / TECHNICAL.md Document serve switch and startup VACUUM behavior.
skills/* Align runtime/quality-doc contracts with serve + VACUUM.
Review details
  • Files reviewed: 18/18 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/version_guard.sh Outdated
Comment thread tests/version_guard.sh Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes the core server launch command (opencode webopencode serve) whose retention-worker API compatibility is not fully exercised in CI and adds startup database mutation, warranting final human review.

Review details
  • Files reviewed: 18/18 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@laurenceputra
laurenceputra merged commit 453559f into main Sep 13, 2026
7 checks passed
@laurenceputra
laurenceputra deleted the feat/startup-vacuum-serve branch September 13, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants