ework-daemon 0.4.41 → 0.4.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.41",
3
+ "version": "0.4.43",
4
4
  "description": "Issue-driven AI development daemon. Spawns opencode subprocesses to resolve Gitea issues.",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
package/src/config.ts CHANGED
@@ -193,6 +193,10 @@ export function loadConfig(): Config {
193
193
  port: process.env.DAEMON_PORT ?? 3101,
194
194
  host: process.env.DAEMON_HOST ?? "0.0.0.0",
195
195
  endpoint: process.env.DAEMON_ENDPOINT ?? "",
196
+ nonWakingAuthors: (process.env.WORK_NON_WAKING_AUTHORS ?? "").split(",").map((s) => s.trim()).filter(Boolean),
197
+ wakeKinds: (process.env.WORK_WAKE_KINDS ?? "human").split(",").map((s) => s.trim()).filter(Boolean),
198
+ wakeLogins: (process.env.WORK_WAKE_LOGINS ?? "").split(",").map((s) => s.trim()).filter(Boolean),
199
+ noWakeLogins: (process.env.WORK_NO_WAKE_LOGINS ?? "").split(",").map((s) => s.trim()).filter(Boolean),
196
200
  },
197
201
  opencode: {
198
202
  binary: process.env.OPENCODE_BINARY ?? "opencode",
package/src/db.ts CHANGED
@@ -543,6 +543,15 @@ async function runMigrations(db: AsyncDatabase): Promise<void> {
543
543
  sqlite ? "generation INTEGER NOT NULL DEFAULT 0" : "generation INT NOT NULL DEFAULT 0"
544
544
  );
545
545
 
546
+ // messages.model — per-message model override from the webhook payload.
547
+ // Persisted so queued/nudged/recovered messages keep their model instead of
548
+ // silently falling back to the daemon default.
549
+ await ensureColumn(
550
+ tMessages,
551
+ "model",
552
+ sqlite ? "model TEXT" : "model VARCHAR(128)"
553
+ );
554
+
546
555
  // Index over owner_daemon_id — added after the column exists. SQLite tolerates
547
556
  // IF NOT EXISTS; MySQL lacks it, so we tolerate ER_DUP_KEYNAME (1061) on re-runs.
548
557
  if (sqlite) {
package/src/op.ts CHANGED
@@ -42,6 +42,7 @@ interface MessageRow {
42
42
  content: string;
43
43
  source_comment_id: string | null;
44
44
  reaction_comment_id: string | null;
45
+ model: string | null;
45
46
  status: string;
46
47
  attempts: number;
47
48
  error: string | null;
@@ -96,6 +97,7 @@ function rowToMessage(row: MessageRow): Message {
96
97
  content: row.content,
97
98
  sourceCommentId: row.source_comment_id ?? undefined,
98
99
  reactionCommentId: row.reaction_comment_id ?? undefined,
100
+ model: row.model ?? undefined,
99
101
  status: row.status as Message["status"],
100
102
  attempts: row.attempts,
101
103
  error: row.error ?? undefined,
@@ -287,8 +289,8 @@ export class Store {
287
289
  const now = new Date().toISOString();
288
290
  const id = crypto.randomUUID();
289
291
  await getDB().run(
290
- "INSERT OR IGNORE INTO {{messages}} (uid, session_id, content, source_comment_id, reaction_comment_id, status, attempts, error, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
291
- [id, sessionId, content, sourceCommentId ?? null, reactionCommentId ?? null, "pending", 0, null, now, now]
292
+ "INSERT OR IGNORE INTO {{messages}} (uid, session_id, content, source_comment_id, reaction_comment_id, model, status, attempts, error, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
293
+ [id, sessionId, content, sourceCommentId ?? null, reactionCommentId ?? null, model ?? null, "pending", 0, null, now, now]
292
294
  );
293
295
  return {
294
296
  id, sessionId, content, sourceCommentId, reactionCommentId,
@@ -49,6 +49,7 @@ CREATE TABLE IF NOT EXISTS {{messages}} (
49
49
  content LONGTEXT NOT NULL,
50
50
  source_comment_id VARCHAR(64),
51
51
  reaction_comment_id VARCHAR(64),
52
+ model VARCHAR(128),
52
53
  status VARCHAR(16) NOT NULL DEFAULT 'pending',
53
54
  attempts INT NOT NULL DEFAULT 0,
54
55
  error TEXT,
@@ -41,6 +41,7 @@ CREATE TABLE IF NOT EXISTS {{messages}} (
41
41
  content TEXT NOT NULL,
42
42
  source_comment_id TEXT,
43
43
  reaction_comment_id TEXT,
44
+ model TEXT,
44
45
  status TEXT NOT NULL DEFAULT 'pending',
45
46
  attempts INTEGER NOT NULL DEFAULT 0,
46
47
  error TEXT,