ework-daemon 0.2.0 → 0.2.1
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 +9 -4
package/package.json
CHANGED
package/src/opencode.ts
CHANGED
|
@@ -481,10 +481,15 @@ export class Engine {
|
|
|
481
481
|
// routing to the last-active lets the user continue without re-@mentioning,
|
|
482
482
|
// while @mention switches to a different AI.
|
|
483
483
|
const sessions = await this.store.getSessionsForIssue(issue.id);
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
484
|
+
let session: OpSession;
|
|
485
|
+
if (sessions.length === 0) {
|
|
486
|
+
log.info(`engine: no session for ${scopeKey}#${ref.issueId} — creating default "${this.cfg.bot.username}"`);
|
|
487
|
+
session = await this.store.createSession(issue.id, this.cfg.bot.username);
|
|
488
|
+
} else {
|
|
489
|
+
const picked = pickLastActive(sessions);
|
|
490
|
+
if (!picked) return;
|
|
491
|
+
session = picked;
|
|
492
|
+
}
|
|
488
493
|
if (dirPath) {
|
|
489
494
|
await this.store.updateSession(session.id, { workdir: dirPath });
|
|
490
495
|
session.workdir = dirPath;
|