diff --git a/apps/server/src/db.ts b/apps/server/src/db.ts index 3a24b33b..b047710f 100644 --- a/apps/server/src/db.ts +++ b/apps/server/src/db.ts @@ -172,6 +172,7 @@ const migrations = { foundation TEXT, placement_space_id TEXT, placement_dir TEXT, + parked INTEGER NOT NULL DEFAULT 0, restarts INTEGER NOT NULL DEFAULT 0, attempt INTEGER, run_state TEXT NOT NULL DEFAULT 'idle', diff --git a/apps/server/src/mirror.ts b/apps/server/src/mirror.ts index 753ffe9c..759ad506 100644 --- a/apps/server/src/mirror.ts +++ b/apps/server/src/mirror.ts @@ -98,6 +98,7 @@ const threadCore = (thread: Codework.ThreadSummary) => { foundation: thread.foundation ?? null, placementSpaceId: thread.placement?.spaceId ?? null, placementDir: thread.placement?.directory ?? null, + parked: thread.parked ? 1 : 0, restarts: thread.restarts, attempt: thread.attempt ?? null, runState: thread.runState, diff --git a/apps/server/src/reads.ts b/apps/server/src/reads.ts index 977ee4ad..403f9ada 100644 --- a/apps/server/src/reads.ts +++ b/apps/server/src/reads.ts @@ -299,6 +299,7 @@ const head = (sql: SqlClient.SqlClient, { sessionId, threadId }: LineRequest) => runEndedAt: number | null; runOutcome: string | null; runError: string | null; + parked: number; updatedAt: number; floor: number | null; dir: string; @@ -309,7 +310,7 @@ const head = (sql: SqlClient.SqlClient, { sessionId, threadId }: LineRequest) => }>` SELECT thread.id, thread.session_id, session.machine_id, thread.title, thread.model_provider, thread.model_id, thread.thinking_level, thread.run_state, thread.run_started_at, thread.run_ended_at, thread.run_outcome, - thread.run_error, thread.updated_at, thread.floor, session.dir, session.hostdir, + thread.run_error, thread.parked, thread.updated_at, thread.floor, session.dir, session.hostdir, project.id AS project_id, project.name AS project_name, thread.deleted_at IS NOT NULL OR session.deleted_at IS NOT NULL AS removed FROM thread @@ -395,6 +396,7 @@ export const line = Effect.fn("Reads.line")(function* (request: LineRequest) { ...(row.thinkingLevel === null ? {} : { thinkingLevel: row.thinkingLevel }), runState: row.runState, ...lastRun, + parked: row.parked === 1, updatedAt: row.updatedAt, directory: row.dir, ...(row.hostdir === null ? {} : { hostDir: row.hostdir }), diff --git a/apps/server/test/__artifacts__/reads.line.json b/apps/server/test/__artifacts__/reads.line.json index ee9ec3c8..7ed3dde5 100644 --- a/apps/server/test/__artifacts__/reads.line.json +++ b/apps/server/test/__artifacts__/reads.line.json @@ -6,6 +6,7 @@ "machineId": "", "title": "Fork prompt", "runState": "idle", + "parked": false, "updatedAt": "