@pentoshi/clai 3.11.33 → 3.11.34
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/agent/runner.js +23 -9
- package/dist/agent/runner.js.map +1 -1
- package/dist/tools/fs.js +17 -5
- package/dist/tools/fs.js.map +1 -1
- package/dist/tools/registry.d.ts +1 -0
- package/dist/tools/registry.js +12 -1
- package/dist/tools/registry.js.map +1 -1
- package/dist/version.generated.d.ts +2 -2
- package/dist/version.generated.js +2 -2
- package/package.json +1 -1
package/dist/agent/runner.js
CHANGED
|
@@ -3731,6 +3731,18 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
3731
3731
|
}
|
|
3732
3732
|
}
|
|
3733
3733
|
if (!canonicalAssistantVisible.trim() && !call) {
|
|
3734
|
+
const incompleteNativeStream = nativeToolCalls.length === 0 &&
|
|
3735
|
+
deferredToolCalls.some((entry) => entry.shown && entry.call.name !== "…");
|
|
3736
|
+
if (incompleteNativeStream) {
|
|
3737
|
+
const reason = "The provider began this native tool call but never completed it. Nothing ran; reissue a complete call.";
|
|
3738
|
+
for (const deferred of deferredToolCalls) {
|
|
3739
|
+
if (!deferred.shown || deferred.call.name === "…")
|
|
3740
|
+
continue;
|
|
3741
|
+
writeToolBlocked(deferred.eventId, deferred.call.name, reason, chalk.yellow(` ⚠ ${reason}\n`));
|
|
3742
|
+
}
|
|
3743
|
+
markTextOnlyModel(provider, model);
|
|
3744
|
+
writeNotice("warn", "provider abandoned a native tool call — switching this model to the text tool protocol", chalk.yellow(" ⚠ provider abandoned a native tool call — switching this model to the text tool protocol\n"));
|
|
3745
|
+
}
|
|
3734
3746
|
emptyVisibleRetries += 1;
|
|
3735
3747
|
if (emptyVisibleRetries <= 3) {
|
|
3736
3748
|
if (assistantText.hasThinking) {
|
|
@@ -3743,15 +3755,17 @@ export async function runAgentTurn(prompt, options = {}) {
|
|
|
3743
3755
|
retryWithoutThinking = true;
|
|
3744
3756
|
commitAssistantRetry(assistantText.visible);
|
|
3745
3757
|
// Keep nudges SHORT — cheap models lose the key instruction in long text.
|
|
3746
|
-
const buildNudge =
|
|
3747
|
-
?
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
"
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
:
|
|
3754
|
-
"
|
|
3758
|
+
const buildNudge = incompleteNativeStream
|
|
3759
|
+
? "Your native tool call was incomplete, so nothing ran. Use exactly one complete fenced ```tool block now; do not repeat the incomplete native call."
|
|
3760
|
+
: isPlanMode && !activePlan
|
|
3761
|
+
? toolsAttached
|
|
3762
|
+
? "No visible output. In plan mode: gather context or call plan.create when ready (do not only describe the plan)."
|
|
3763
|
+
: "No visible output. In plan mode: emit a ```tool block for research/recon or plan.create. " +
|
|
3764
|
+
"Do NOT hide tool calls in <think> tags — put them in the visible response."
|
|
3765
|
+
: toolsAttached
|
|
3766
|
+
? "No visible output. " + toolNudge(true)
|
|
3767
|
+
: "No visible output. Emit a ```tool block or give your final answer. " +
|
|
3768
|
+
"Do NOT hide tool calls in <think> tags — put them in the visible response.";
|
|
3755
3769
|
messages.push(recoveryUserMessage(buildNudge));
|
|
3756
3770
|
continue;
|
|
3757
3771
|
}
|