@usabledev/usable-chat 1.207.3 → 1.207.4
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/cli.js +21 -5
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -362969,14 +362969,28 @@ function shouldRecoverSilentStop({
|
|
|
362969
362969
|
recoveryAttempted,
|
|
362970
362970
|
recoverPreToolStop = false
|
|
362971
362971
|
}) {
|
|
362972
|
-
|
|
362972
|
+
const stoppedBeforeAction = !text5?.trim() || recoverPreToolStop && isIncompleteWorkActionPreamble(text5);
|
|
362973
|
+
return !recoveryAttempted && stoppedBeforeAction && (lastStepHadToolErrors || lastStepHadToolActivity || recoverPreToolStop);
|
|
362974
|
+
}
|
|
362975
|
+
function isIncompleteWorkActionPreamble(text5) {
|
|
362976
|
+
const value = text5?.trim();
|
|
362977
|
+
if (!value || value.length > 160 || /[\n:;—–]|```/.test(value)) return false;
|
|
362978
|
+
const withoutLeadIn = value.replace(/^sure[,!.]?\s*/i, "");
|
|
362979
|
+
const withoutTerminalPunctuation = withoutLeadIn.replace(/[.!?]$/, "");
|
|
362980
|
+
if (/[,.!?]/.test(withoutTerminalPunctuation)) return false;
|
|
362981
|
+
if (!/(?:\bfor you|\bnow|\bnext|\bright away|\bshortly|\bmomentarily|\bfirst)[.!?]?$/i.test(value)) {
|
|
362982
|
+
return false;
|
|
362983
|
+
}
|
|
362984
|
+
return /^(?:sure[,!.]?\s*)?(?:i(?:'ll|\s+will|\s+am going to)|let me)\s+(?:now\s+)?(?:retrieve|fetch|look up|check|find|list|gather|inspect|run|execute|search|load|open|read|create|update|write|analy[sz]e)\b/i.test(
|
|
362985
|
+
value
|
|
362986
|
+
);
|
|
362973
362987
|
}
|
|
362974
362988
|
function resolveSilentStopResponse({
|
|
362975
362989
|
text: text5,
|
|
362976
362990
|
recoveryAttempted,
|
|
362977
362991
|
recoverPreToolStop
|
|
362978
362992
|
}) {
|
|
362979
|
-
if (recoverPreToolStop && recoveryAttempted && !text5?.trim()) {
|
|
362993
|
+
if (recoverPreToolStop && recoveryAttempted && (!text5?.trim() || isIncompleteWorkActionPreamble(text5))) {
|
|
362980
362994
|
return "I could not complete that Work request. Please try again.";
|
|
362981
362995
|
}
|
|
362982
362996
|
return text5 || "";
|
|
@@ -366648,7 +366662,9 @@ ${combinedSystemMessage}` : combinedSystemMessage;
|
|
|
366648
366662
|
);
|
|
366649
366663
|
if (receipt) {
|
|
366650
366664
|
if (receipt.outcome === "unknown")
|
|
366651
|
-
throw new Error(
|
|
366665
|
+
throw new Error(
|
|
366666
|
+
"Earlier tool outcome is unknown; repeating this action requires user resolution."
|
|
366667
|
+
);
|
|
366652
366668
|
return receipt.result;
|
|
366653
366669
|
}
|
|
366654
366670
|
}
|
|
@@ -367470,7 +367486,7 @@ Re-read them (working_memory on web, bash on the CLI \u2014 grep/sed projection,
|
|
|
367470
367486
|
recoverPreToolStop: context3.metadata?.workRuntime === "machine"
|
|
367471
367487
|
})) {
|
|
367472
367488
|
recoveryAttempted = true;
|
|
367473
|
-
const recoveryPrompt = lastStepHadToolErrors ? "The previous tool call failed. Briefly summarise to the user what happened, why it likely failed, and any next steps they could take (without retrying the failed tool)." : lastStepHadToolActivity ? "The previous step used tools but did not produce a visible final answer. Using the available tool results, answer the user now. Do not call more tools unless absolutely required." : "The previous response
|
|
367489
|
+
const recoveryPrompt = lastStepHadToolErrors ? "The previous tool call failed. Briefly summarise to the user what happened, why it likely failed, and any next steps they could take (without retrying the failed tool)." : lastStepHadToolActivity ? "The previous step used tools but did not produce a visible final answer. Using the available tool results, answer the user now. Do not call more tools unless absolutely required." : "The previous response stopped before completing the requested action. Do not merely announce what you will do. Complete the user's original request now and call the required tool when one is available.";
|
|
367474
367490
|
orchestrationLogger.warn(
|
|
367475
367491
|
"Model stopped silently \u2014 injecting recovery prompt",
|
|
367476
367492
|
{
|
|
@@ -391558,7 +391574,7 @@ init_tui_select();
|
|
|
391558
391574
|
init_model_registry();
|
|
391559
391575
|
|
|
391560
391576
|
// package.json
|
|
391561
|
-
var version2 = "1.207.
|
|
391577
|
+
var version2 = "1.207.4";
|
|
391562
391578
|
|
|
391563
391579
|
// src/adapters/cli/model-catalog.ts
|
|
391564
391580
|
init_codex_auth();
|