ework-daemon 0.4.52 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.52",
3
+ "version": "0.4.53",
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/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
@@ -1363,6 +1363,10 @@ export class Engine {
1363
1363
  if (hasRecent) {
1364
1364
  const matched = commentsNow.find(c => tracker.isBotUser(c.author) && !this.isSystemComment(c) && c.createdAt && new Date(c.createdAt).getTime() > (started ?? 0));
1365
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
+ }
1366
1370
  this.nudgeRounds.delete(k);
1367
1371
  this.emptyResponseRounds.delete(k);
1368
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(
@@ -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