ework-daemon 0.4.66 → 0.4.67

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 +9 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.66",
3
+ "version": "0.4.67",
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
@@ -938,7 +938,7 @@ export class Engine {
938
938
  // (or hit the 10-min cap), and the user must see pickup feedback immediately.
939
939
  // The session link is a placeholder until the backend reports its session id;
940
940
  // the onSessionId callback rewrites this comment with the real reference.
941
- await tracker.createComment(ref, `[system] 🔄 **${session.name}** picked up this issue — preparing workspace…`).then(
941
+ await tracker.createComment(ref, `[system] 🏷 ${this.sessionRef(session)} 🔄 **${session.name}** picked up this issue — preparing workspace…`).then(
942
942
  (c) => this.pickupCommentId.set(k, c.id),
943
943
  () => {},
944
944
  );
@@ -1029,7 +1029,7 @@ export class Engine {
1029
1029
 
1030
1030
  // Immediate ack
1031
1031
  {
1032
- 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)}`);
1032
+ const c = await tracker.createComment(ref, `[system] 🏷 ${this.sessionRef(session)} ✓ Message forwarded to **${session.name}**${this.running.has(this.sessionKey(session, issue)) ? " (running)" : ""}.\n> workdir: ${this.workdirLink(workdir)}`);
1033
1033
  if (!session.opencodeSessionId) this.forwardCommentId.set(this.sessionKey(session, issue), c.id);
1034
1034
  }
1035
1035
 
@@ -1043,7 +1043,7 @@ export class Engine {
1043
1043
  }
1044
1044
  const workdir = await this.resolveWorkdir(session, issue);
1045
1045
 
1046
- await tracker.createComment(ref, `[system] 🔄 **${session.name}** joined the conversation.`);
1046
+ await tracker.createComment(ref, `[system] 🏷 ${this.sessionRef(session)} 🔄 **${session.name}** joined the conversation.`);
1047
1047
 
1048
1048
  const instructions = tracker.getTrackerInstructions(ref);
1049
1049
  const payloadClone = this.cloneUrls.get(`${ref.trackerType}:${scopeKey}#${ref.issueId}`);
@@ -1080,7 +1080,7 @@ export class Engine {
1080
1080
  session.name, this.handleLargeContent(workdir, comment.body, `comment-${comment.id}.txt`),
1081
1081
  comment.author, comment.authorKind, issueData.title, workdir, instructions
1082
1082
  );
1083
- 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)}`);
1083
+ await tracker.createComment(ref, `[system] 🏷 ${this.sessionRef(session)} ✓ Message forwarded to **${session.name}**${this.running.has(this.sessionKey(session, issue)) ? " (running)" : ""}.\n> workdir: ${this.workdirLink(workdir)}`);
1084
1084
  await this.enqueueOrRun(session, issue, prompt, comment.id, model);
1085
1085
  }
1086
1086
  } finally {
@@ -1392,13 +1392,13 @@ export class Engine {
1392
1392
  this.pickupCommentId.delete(k);
1393
1393
  this.forwardCommentId.delete(k);
1394
1394
  await tracker
1395
- .editComment(ref, pickupId, `[system] 🔄 **${session.name}** picked up this issue.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`)
1395
+ .editComment(ref, pickupId, `[system] 🏷 ${this.sessionRef(session)} 🔄 **${session.name}** picked up this issue.\n> workdir: ${this.workdirLink(workdir)}`)
1396
1396
  .catch((err) => log.error(`engine: failed to rewrite pickup comment for ${k}:`, (err as Error).message));
1397
1397
  }
1398
1398
  const forwardId = this.forwardCommentId.get(k);
1399
1399
  if (forwardId) {
1400
1400
  this.forwardCommentId.delete(k);
1401
- const body = `[system] ✓ Message forwarded to **${session.name}**${this.running.has(k) ? " (running)" : ""}.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`;
1401
+ const body = `[system] 🏷 ${this.sessionRef(session)} ✓ Message forwarded to **${session.name}**${this.running.has(k) ? " (running)" : ""}.\n> workdir: ${this.workdirLink(workdir)}`;
1402
1402
  await tracker.editComment(ref, forwardId, body).catch(() => { /* cosmetic rewrite */ });
1403
1403
  }
1404
1404
  }
@@ -1563,7 +1563,7 @@ export class Engine {
1563
1563
  log.error(`engine: empty model response for ${k} after ${emptyRound} retries, reporting error`);
1564
1564
  this.emptyResponseRounds.delete(k);
1565
1565
  this.nudgeRounds.delete(k);
1566
- await tracker.createComment(ref, `[system] ❌ **${session.name}** 模型返回空响应(0 token),已重试 ${emptyRound} 次。请检查模型配置或稍后重试。`).catch(() => {});
1566
+ await tracker.createComment(ref, `[system] 🏷 ${this.sessionRef(session)} ❌ **${session.name}** 模型返回空响应(0 token),已重试 ${emptyRound} 次。请检查模型配置或稍后重试。`).catch(() => {});
1567
1567
  void tracker.updateStatus(ref, "failed", "empty model response");
1568
1568
  } else {
1569
1569
  const nudgeRound = this.nudgeRounds.get(k) ?? 0;
@@ -1582,7 +1582,7 @@ export class Engine {
1582
1582
  log.info(`engine: no [bot] reply for ${k} (promptTime=${started ?? "unknown"}), marking done (nudge exhausted or process failed)`);
1583
1583
  this.nudgeRounds.delete(k);
1584
1584
  const detail = exitCode === 0 ? "ran but did not post a reply" : `crashed (exit ${exitCode})`;
1585
- await tracker.createComment(ref, `[system] ❌ **${session.name}** ${detail}. Try posting again or @${session.name} to retry.`).catch(() => {});
1585
+ await tracker.createComment(ref, `[system] 🏷 ${this.sessionRef(session)} ❌ **${session.name}** ${detail}. Try posting again or @${session.name} to retry.`).catch(() => {});
1586
1586
  void tracker.updateStatus(ref, "failed", detail);
1587
1587
  }
1588
1588
  }
@@ -1975,7 +1975,7 @@ export class Engine {
1975
1975
 
1976
1976
  const ref = this.sessionToRef(session, issue);
1977
1977
  const duration = this.formatDuration(now - started);
1978
- const body = `[system] ⏳ **${session.name}** processing, running for ${duration}...`;
1978
+ const body = `[system] 🏷 ${this.sessionRef(session)} ⏳ **${session.name}** processing, running for ${duration}...`;
1979
1979
 
1980
1980
  const existingId = this.progressCommentId.get(k);
1981
1981
  try {