@khalilgharbaoui/opencode-claude-code-plugin 0.4.14 → 0.4.16

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/dist/index.js CHANGED
@@ -1571,9 +1571,15 @@ function looksLikeBlocker(text) {
1571
1571
  }
1572
1572
  function looksLikeFinalAnswer(text) {
1573
1573
  const normalized = normalizeVisibleText(text).toLowerCase();
1574
- if (normalized.length < 30) return false;
1575
1574
  if (looksLikeQuestion(normalized) || looksLikeBlocker(normalized)) return false;
1576
- return /\b(done|completed|fixed|implemented|verified|published|released|sent|delivered|updated)\b/.test(normalized) || /\b(checks?|tests?) passed\b/.test(normalized) || /\b(summary|what changed|verification)\b/.test(normalized);
1575
+ if (/\b(we'?re done|we are done|all done|all set)\b/.test(normalized)) {
1576
+ return true;
1577
+ }
1578
+ if (normalized.length < 30) return false;
1579
+ return /\b(done|completed|fixed|implemented|verified|published|released|sent|delivered|updated|shipped|deployed|merged|tagged|live|pinned)\b/.test(normalized) || // v0.4.15: also accept present-tense "tests pass" / "checks pass".
1580
+ // Real fire 03:31 ended in "78/78 tests pass" — past-tense-only regex
1581
+ // missed it.
1582
+ /\b(checks?|tests?) (?:pass|passes|passed)\b/.test(normalized) || /\b(summary|what changed|verification)\b/.test(normalized);
1577
1583
  }
1578
1584
  function continuationSignature(snapshot) {
1579
1585
  const text = normalizeVisibleText(snapshot.text).slice(-500);
@@ -1588,6 +1594,12 @@ function shouldAutoContinueIncompleteTurn(state, snapshot) {
1588
1594
  if (state.enabled === false) return { continue: false, reason: "disabled" };
1589
1595
  if (snapshot.isError) return { continue: false, reason: "error" };
1590
1596
  if (state.aborted) return { continue: false, reason: "aborted" };
1597
+ if (snapshot.stopReason) {
1598
+ return {
1599
+ continue: false,
1600
+ reason: snapshot.stopReason.replace(/_/g, "-")
1601
+ };
1602
+ }
1591
1603
  if (state.attempts >= AUTO_CONTINUE_MAX_ATTEMPTS) {
1592
1604
  return { continue: false, reason: "max-attempts" };
1593
1605
  }
@@ -2565,6 +2577,7 @@ ${plan}
2565
2577
  let hadReasoningSinceContinue = false;
2566
2578
  let hadToolActivitySinceContinue = false;
2567
2579
  let hadProxyActivitySinceContinue = false;
2580
+ let lastStopReason = null;
2568
2581
  const autoContinueState = {
2569
2582
  enabled: self.config.autoContinueIncompleteTurns,
2570
2583
  attempts: 0,
@@ -2665,6 +2678,7 @@ ${plan}
2665
2678
  hadReasoningSinceContinue = false;
2666
2679
  hadToolActivitySinceContinue = false;
2667
2680
  hadProxyActivitySinceContinue = false;
2681
+ lastStopReason = null;
2668
2682
  };
2669
2683
  let gotPartialEvents = false;
2670
2684
  const lineHandler = (line) => {
@@ -2874,6 +2888,12 @@ ${plan}
2874
2888
  }
2875
2889
  }
2876
2890
  }
2891
+ if (gotPartialEvents && msg.type === "message_delta" && typeof msg.delta?.stop_reason === "string") {
2892
+ lastStopReason = msg.delta.stop_reason;
2893
+ }
2894
+ if (msg.type === "assistant" && msg.message && typeof msg.message.stop_reason === "string") {
2895
+ lastStopReason = msg.message.stop_reason;
2896
+ }
2877
2897
  if (msg.type === "assistant" && msg.message?.content && !gotPartialEvents) {
2878
2898
  const hasText = msg.message.content.some(
2879
2899
  (b) => b.type === "text" && b.text
@@ -3107,7 +3127,8 @@ ${plan}
3107
3127
  hadReasoning: hadReasoningSinceContinue,
3108
3128
  hadToolActivity: hadToolActivitySinceContinue,
3109
3129
  hadProxyActivity: hadProxyActivitySinceContinue,
3110
- isError: msg.is_error
3130
+ isError: msg.is_error,
3131
+ stopReason: lastStopReason
3111
3132
  }
3112
3133
  );
3113
3134
  if (autoDecision.continue) {
@@ -3140,6 +3161,7 @@ ${plan}
3140
3161
  log.notice("auto-continuation stopped", {
3141
3162
  sessionKey: sk,
3142
3163
  reason: autoDecision.reason,
3164
+ stopReason: lastStopReason,
3143
3165
  attempts: autoContinueState.attempts,
3144
3166
  textLength: visibleTextSinceContinue.length,
3145
3167
  lastTextLength: lastVisibleTextSinceContinue.length,