ework-daemon 0.4.65 → 0.4.66

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 +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.65",
3
+ "version": "0.4.66",
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
@@ -787,6 +787,21 @@ export class Engine {
787
787
  const tracker = this.getTracker(ref.trackerType);
788
788
  const scopeKey = tracker.formatScopeKey(ref.scope);
789
789
 
790
+ // State bookkeeping that must survive every wake gate: `issue_closed` is
791
+ // never gated, so if a later `reopened` (mapped to issue_opened) is
792
+ // dropped by paused/halted/dispatch_off/wake gates, the row stays
793
+ // "closed" forever and swallows ALL future comments ("is closed in DB").
794
+ // Heal the stale state unconditionally; dispatch remains gated below.
795
+ if (event.type === "issue_opened") {
796
+ const existing = await this.store.findIssue(ref.trackerType, scopeKey, ref.issueId);
797
+ if (existing?.state === "closed") {
798
+ await this.store.updateIssueState(existing.id, "active");
799
+ log.info(
800
+ `engine: reopened — cleared stale closed state for ${ref.trackerType}:${scopeKey}#${ref.issueId} (bookkeeping only; dispatch still gated)`,
801
+ );
802
+ }
803
+ }
804
+
790
805
  if (this.paused && (event.type === "issue_opened" || event.type === "comment_created")) {
791
806
  log.info(`engine: paused — skipping ${event.type} for ${ref.trackerType}:${scopeKey}#${ref.issueId}`);
792
807
  return;