Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
- name: Install OpenCode CLI
run: |
source scripts/lib/opencode-release.sh
download_opencode_to 2.1.2 "$RUNNER_TEMP/opencode/bin/opencode"
download_opencode_to 2.2.1 "$RUNNER_TEMP/opencode/bin/opencode"
echo "$RUNNER_TEMP/opencode/bin" >> "$GITHUB_PATH"

- name: Verify OpenCode CLI
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ FROM base AS runner
# an arm64 host builds the amd64 platform; 0.12.7 is the newest verified-good
# release, so re-verify a bump there before moving it.
ARG UV_VERSION=0.12.7
ARG OPENCODE_VERSION=2.1.2
ARG OPENCODE_VERSION=2.2.1
ARG MICROSANDBOX_VERSION=0.7.2
ARG PLAYWRIGHT_VERSION=1.63.0
# Bump TOOLS_CACHEBUST (e.g. via --build-arg) to force a fresh uv/opencode
Expand Down
34 changes: 32 additions & 2 deletions backend/src/db/migrations/026-session-goals.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
import type { Migration } from '../migration-runner'
import { ensureSessionGoalsTable } from '../session-goals'

const migration: Migration = {
id: '026-session-goals',
legacy: { version: 26, name: 'session-goals' },
up(db) {
ensureSessionGoalsTable(db)
db.run(`
CREATE TABLE IF NOT EXISTS session_goals (
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id TEXT NOT NULL,
server_id TEXT NOT NULL DEFAULT 'local',
directory TEXT NOT NULL,
objective TEXT NOT NULL,
status TEXT NOT NULL CHECK(status IN ('active','paused','completed','blocked','stopped')),
stop_reason TEXT,
turn_state TEXT NOT NULL DEFAULT 'waiting',
continuation_count INTEGER NOT NULL DEFAULT 0,
max_continuations INTEGER NOT NULL,
token_budget INTEGER,
tokens_at_start INTEGER NOT NULL DEFAULT 0,
tokens_used INTEGER NOT NULL DEFAULT 0,
consecutive_blocked INTEGER NOT NULL DEFAULT 0,
last_verdict TEXT,
last_reason TEXT,
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL,
finished_at INTEGER
)
`)
db.run(`
CREATE UNIQUE INDEX IF NOT EXISTS idx_session_goals_open
ON session_goals(server_id, session_id)
WHERE status IN ('active','paused')
`)
db.run(`
CREATE INDEX IF NOT EXISTS idx_session_goals_session
ON session_goals(session_id, created_at DESC)
`)
},
down(db) {
db.run('DROP TABLE IF EXISTS session_goals')
Expand Down
53 changes: 53 additions & 0 deletions backend/src/db/migrations/202610291200-drop-session-goals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import type { Database } from 'bun:sqlite'
import type { Migration } from '../migration-runner'

function createSessionGoalsTable(db: Database): void {
db.run(`
CREATE TABLE IF NOT EXISTS session_goals (
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id TEXT NOT NULL,
server_id TEXT NOT NULL DEFAULT 'local',
directory TEXT NOT NULL,
objective TEXT NOT NULL,
status TEXT NOT NULL CHECK(status IN ('active','paused','completed','blocked','stopped')),
stop_reason TEXT,
turn_state TEXT NOT NULL DEFAULT 'waiting',
continuation_count INTEGER NOT NULL DEFAULT 0,
max_continuations INTEGER NOT NULL,
token_budget INTEGER,
tokens_at_start INTEGER NOT NULL DEFAULT 0,
tokens_used INTEGER NOT NULL DEFAULT 0,
consecutive_blocked INTEGER NOT NULL DEFAULT 0,
last_verdict TEXT,
last_reason TEXT,
created_at INTEGER NOT NULL,
updated_at INTEGER NOT NULL,
finished_at INTEGER
)
`)
db.run(`
CREATE UNIQUE INDEX IF NOT EXISTS idx_session_goals_open
ON session_goals(server_id, session_id)
WHERE status IN ('active','paused')
`)
db.run(`
CREATE INDEX IF NOT EXISTS idx_session_goals_session
ON session_goals(session_id, created_at DESC)
`)
}

const migration: Migration = {
id: '202610291200-drop-session-goals',

up(db) {
db.run('DROP INDEX IF EXISTS idx_session_goals_open')
db.run('DROP INDEX IF EXISTS idx_session_goals_session')
db.run('DROP TABLE IF EXISTS session_goals')
},

down(db) {
createSessionGoalsTable(db)
},
}

export default migration
2 changes: 2 additions & 0 deletions backend/src/db/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { secretsGlobalScopeIndexMigration } from './202610181410-secrets-global-
import migration202610221800 from './202610221800-session-device-name'
import migration202610231200 from './202610231200-push-subscription-session-id'
import migration202610251900 from './202610251900-schedule-sandbox-config'
import migration202610291200 from './202610291200-drop-session-goals'

export const allMigrations: Migration[] = [
migration001,
Expand Down Expand Up @@ -87,4 +88,5 @@ export const allMigrations: Migration[] = [
migration202610221800,
migration202610231200,
migration202610251900,
migration202610291200,
]
268 changes: 0 additions & 268 deletions backend/src/db/session-goals.ts

This file was deleted.

Loading