Repository navigation
feat: add sqlite task runtime plugin - #25
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a SQLite-backed task runtime plugin under .opencode/plugins to drive task dispatch/progress tracking via <projectDir>/aim.sqlite, along with repo-level integration tests and accompanying Chinese design spec + implementation plan.
Changes:
- Introduces
sqlite-task-runtimeplugin entrypoint exposing 6 tools (dispatch-tasks,list-processing-tasks,get-current-task,mark-task-status,setup-worktree-path,setup-pull-request-url) wired to a SQLite repository + session host adapter. - Implements SQLite repository helpers (task listing/binding, status and artifact write-back) and prompt builders that avoid exposing SQLite internals.
- Adds extensive repo integration tests and documents the design + implementation plan.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/repo/sqlite-task-runtime-plugin.test.ts |
Repo-level integration tests for sqlite task runtime plugin behavior and prompt boundaries. |
docs/superpowers/specs/2026-04-18-sqlite-task-runtime-design.md |
Design spec describing plugin boundaries, tool contract, and dispatch flow. |
docs/superpowers/plans/2026-04-18-sqlite-task-runtime.md |
Implementation plan/checklist for building the plugin and tests. |
.opencode/plugins/task-runtime-sqlite/task-repository.ts |
SQLite-backed task repository (binding, scanning, write-back rules). |
.opencode/plugins/task-runtime-sqlite/session-runtime.ts |
Minimal host adapter for session operations used by dispatch. |
.opencode/plugins/task-runtime-sqlite/prompt-builder.ts |
Prompt formatting for initial/follow-up task prompts without SQLite details. |
.opencode/plugins/task-runtime-sqlite/database.ts |
SQLite path resolution + DB open helper for <projectDir>/aim.sqlite. |
.opencode/plugins/task-runtime-sqlite.ts |
Plugin entrypoint registering tools and implementing dispatch logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const getTaskRuntimeDatabasePath = (projectDir: string) => | ||
| join(projectDir, "aim.sqlite"); | ||
|
|
||
| export const openTaskRuntimeDatabase = (projectDir: string) => | ||
| new DatabaseSync(getTaskRuntimeDatabasePath(projectDir)); |
There was a problem hiding this comment.
openTaskRuntimeDatabase() uses new DatabaseSync(path) which will create aim.sqlite when it doesn’t exist. The design spec in this PR says the plugin should error when the DB is missing or schema is invalid; auto-creating an empty DB can hide misconfiguration and lead to dispatch operating against the wrong file. Consider checking file existence (and optionally opening read-only if supported) and throwing a clear error before creating/using the DB.
| vi.doMock( | ||
| "../../.opencode/plugins/task-runtime-sqlite/database.ts", | ||
| () => ({ | ||
| createTaskRuntimeDatabase, | ||
| }), | ||
| ); |
There was a problem hiding this comment.
These vi.doMock() specifiers use .../task-runtime-sqlite/*.ts, but the plugin entrypoint imports the collaborators using .js specifiers (e.g. ./task-runtime-sqlite/database.js). In Vitest/NodeNext setups, mocks are keyed by the import specifier, so this mock may not intercept what the entrypoint actually imports and the test may pass without exercising the intended assertion. Use mock specifiers that match the entrypoint imports (or otherwise ensure the mock applies to the resolved module id).
Summary
Test Plan