Vacuum OpenCode database before serving - #21
Conversation
There was a problem hiding this comment.
🟡 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 serveacross the wrapper, entrypoint smoke checks, docs, and skills. - Add startup
VACUUMmaintenance in the entrypoint plussqlite3in the runtime image, with new unit tests and CI (real VACUUM + authenticatedopencode servesmoke test). - Rework
tests/version_guard.shto handle merge commits, addtests/test_version_guard.sh, and bumpVERSION/CHANGELOG.mdto 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.
There was a problem hiding this comment.
🔵 Needs a closer look
It changes the core server launch command (opencode web → opencode 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
Summary
opencode webtoopencode serveValidation
bash tests/run.shbash -n .opencode_web_yolo.sh .opencode_web_yolo_config.sh .opencode_web_yolo_entrypoint.sh .opencode_web_yolo_runtime.sh install.sh tests/*.shgit diff --check