ework-daemon 0.4.51 → 0.4.53
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/gitea.ts +9 -0
- package/src/opencode.ts +15 -0
- package/src/trackers/gitea-tracker.ts +6 -0
- package/src/trackers/types.ts +1 -0
package/package.json
CHANGED
package/src/gitea.ts
CHANGED
|
@@ -134,6 +134,15 @@ export class GiteaClient {
|
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
async setCommentModel(owner: string, repo: string, commentId: number, model: string) {
|
|
138
|
+
return this.request(
|
|
139
|
+
"POST",
|
|
140
|
+
`/repos/${owner}/${repo}/issues/comments/${commentId}/model`,
|
|
141
|
+
{ model },
|
|
142
|
+
true
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
137
146
|
async addCommentReaction(owner: string, repo: string, commentId: number, content: string) {
|
|
138
147
|
return this.request(
|
|
139
148
|
"POST",
|
package/src/opencode.ts
CHANGED
|
@@ -1148,6 +1148,17 @@ export class Engine {
|
|
|
1148
1148
|
// Update session state
|
|
1149
1149
|
await this.store.updateSession(session.id, { state: "running" });
|
|
1150
1150
|
|
|
1151
|
+
// Every execution path funnels through here (opened, commented, new-session
|
|
1152
|
+
// on comment, preempt re-run, retry) — the badge must flip for all of them,
|
|
1153
|
+
// not only for the initial issue-opened ack.
|
|
1154
|
+
const tracker = this.trackers.get(issue.trackerType);
|
|
1155
|
+
if (tracker) {
|
|
1156
|
+
void tracker.updateStatus(
|
|
1157
|
+
{ trackerType: issue.trackerType, scope: issue.trackerScope, issueId: issue.trackerIssueId },
|
|
1158
|
+
"processing",
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1151
1162
|
void this.execProcess(k, session, issue, msg);
|
|
1152
1163
|
}
|
|
1153
1164
|
|
|
@@ -1352,6 +1363,10 @@ export class Engine {
|
|
|
1352
1363
|
if (hasRecent) {
|
|
1353
1364
|
const matched = commentsNow.find(c => tracker.isBotUser(c.author) && !this.isSystemComment(c) && c.createdAt && new Date(c.createdAt).getTime() > (started ?? 0));
|
|
1354
1365
|
log.info(`engine: [bot] reply found for ${k} after prompt (comment ${matched?.id ?? "?"} createdAt ${matched?.createdAt ?? "?"}), marking done`);
|
|
1366
|
+
const usedModel = this.currentModel.get(k) ?? "";
|
|
1367
|
+
if (matched && usedModel) {
|
|
1368
|
+
void tracker.setCommentModel(ref, matched.id, usedModel).catch(() => { /* display-only */ });
|
|
1369
|
+
}
|
|
1355
1370
|
this.nudgeRounds.delete(k);
|
|
1356
1371
|
this.emptyResponseRounds.delete(k);
|
|
1357
1372
|
await this.persistRuntimeState(session.id);
|
|
@@ -71,6 +71,12 @@ export class GiteaTracker implements IssueTracker {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
async setCommentModel(ref: TrackerRef, commentId: string, model: string) {
|
|
75
|
+
await this.client.setCommentModel(
|
|
76
|
+
this.owner(ref), this.repo(ref), Number(commentId), model
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
74
80
|
async setReaction(ref: TrackerRef, commentId: string, content: string, remove = false) {
|
|
75
81
|
if (remove) {
|
|
76
82
|
await this.client.removeCommentReaction(
|
package/src/trackers/types.ts
CHANGED
|
@@ -138,6 +138,7 @@ export interface IssueTracker {
|
|
|
138
138
|
updateStatus(ref: TrackerRef, status: string, detail?: string): Promise<void>;
|
|
139
139
|
|
|
140
140
|
setReaction(ref: TrackerRef, commentId: string, content: string, remove?: boolean): Promise<void>;
|
|
141
|
+
setCommentModel(ref: TrackerRef, commentId: string, model: string): Promise<void>;
|
|
141
142
|
|
|
142
143
|
getTrackerInstructions(ref: TrackerRef): TrackerInstructions;
|
|
143
144
|
|