ework-daemon 0.4.56 → 0.4.57

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/opencode.ts +12 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.56",
3
+ "version": "0.4.57",
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/opencode.ts CHANGED
@@ -332,6 +332,7 @@ export class Engine {
332
332
  private startedAt = new Map<string, number>();
333
333
  private progressCommentId = new Map<string, string>();
334
334
  private pickupCommentId = new Map<string, string>();
335
+ private forwardCommentId = new Map<string, string>();
335
336
 
336
337
  private nudgeRounds = new Map<string, number>();
337
338
  private emptyResponseRounds = new Map<string, number>();
@@ -894,7 +895,10 @@ export class Engine {
894
895
  );
895
896
 
896
897
  // Immediate ack
897
- await tracker.createComment(ref, `[system] ✓ Message forwarded to **${session.name}**${this.running.has(this.sessionKey(session, issue)) ? " (running)" : ""}.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`);
898
+ {
899
+ const c = await tracker.createComment(ref, `[system] ✓ Message forwarded to **${session.name}**${this.running.has(this.sessionKey(session, issue)) ? " (running)" : ""}.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`);
900
+ if (!session.opencodeSessionId) this.forwardCommentId.set(this.sessionKey(session, issue), c.id);
901
+ }
898
902
 
899
903
  await this.enqueueOrRun(session, issue, prompt, comment.id, model);
900
904
  } else {
@@ -1230,10 +1234,17 @@ export class Engine {
1230
1234
  const pickupId = this.pickupCommentId.get(k);
1231
1235
  if (pickupId) {
1232
1236
  this.pickupCommentId.delete(k);
1237
+ this.forwardCommentId.delete(k);
1233
1238
  await tracker
1234
1239
  .editComment(ref, pickupId, `[system] 🔄 **${session.name}** picked up this issue.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`)
1235
1240
  .catch((err) => log.error(`engine: failed to rewrite pickup comment for ${k}:`, (err as Error).message));
1236
1241
  }
1242
+ const forwardId = this.forwardCommentId.get(k);
1243
+ if (forwardId) {
1244
+ this.forwardCommentId.delete(k);
1245
+ const body = `[system] ✓ Message forwarded to **${session.name}**${this.running.has(k) ? " (running)" : ""}.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`;
1246
+ await tracker.editComment(ref, forwardId, body).catch(() => { /* cosmetic rewrite */ });
1247
+ }
1237
1248
  }
1238
1249
  },
1239
1250
  },