ework-daemon 0.4.12 → 0.4.14
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 +1 -1
- package/src/opencode.ts +13 -3
package/package.json
CHANGED
package/src/opencode.ts
CHANGED
|
@@ -259,6 +259,16 @@ export class Engine {
|
|
|
259
259
|
void this.recover();
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
private workdirLink(workdir: string): string {
|
|
263
|
+
const p = encodeURIComponent(workdir);
|
|
264
|
+
return `[${workdir}](/file?path=${p}&daemon_id=${this.daemonId})`;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
private sessionRef(session: { id: string; opencodeSessionId?: string | null }): string {
|
|
268
|
+
const ses = session.opencodeSessionId || session.id;
|
|
269
|
+
return `[\`${ses}\`](/sessions/${encodeURIComponent(ses)}?daemon_id=${this.daemonId})`;
|
|
270
|
+
}
|
|
271
|
+
|
|
262
272
|
/** Start the lease heartbeat. Must be called once after registerDaemon. */
|
|
263
273
|
startHeartbeat(intervalMs: number): void {
|
|
264
274
|
if (this.heartbeatTimer) clearInterval(this.heartbeatTimer);
|
|
@@ -498,7 +508,7 @@ export class Engine {
|
|
|
498
508
|
const workdir = await this.resolveWorkdir(session, issue);
|
|
499
509
|
log.info(`engine: session "${session.name}" created for ${k}, workdir=${workdir}`);
|
|
500
510
|
|
|
501
|
-
await tracker.createComment(ref, `[system] 🔄 **${session.name}** picked up this issue.\n> session:
|
|
511
|
+
await tracker.createComment(ref, `[system] 🔄 **${session.name}** picked up this issue.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`);
|
|
502
512
|
|
|
503
513
|
const instructions = tracker.getTrackerInstructions(ref);
|
|
504
514
|
const prompt = this.buildInitialPrompt(
|
|
@@ -580,7 +590,7 @@ export class Engine {
|
|
|
580
590
|
);
|
|
581
591
|
|
|
582
592
|
// Immediate ack
|
|
583
|
-
await tracker.createComment(ref, `[system] ✓ Message forwarded to **${session.name}**${this.running.has(this.sessionKey(session, issue)) ? " (running)" : ""}.\n> session:
|
|
593
|
+
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)}`);
|
|
584
594
|
|
|
585
595
|
await this.enqueueOrRun(session, issue, prompt, comment.id, model);
|
|
586
596
|
} else {
|
|
@@ -627,7 +637,7 @@ export class Engine {
|
|
|
627
637
|
session.name, this.handleLargeContent(workdir, comment.body, `comment-${comment.id}.txt`),
|
|
628
638
|
comment.author, issueData.title, workdir, instructions
|
|
629
639
|
);
|
|
630
|
-
await tracker.createComment(ref, `[system] ✓ Message forwarded to **${session.name}**${this.running.has(this.sessionKey(session, issue)) ? " (running)" : ""}.\n> session:
|
|
640
|
+
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)}`);
|
|
631
641
|
await this.enqueueOrRun(session, issue, prompt, comment.id, model);
|
|
632
642
|
}
|
|
633
643
|
} finally {
|