prior-cli 1.3.0 → 1.3.1
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/bin/prior.js +1 -0
- package/lib/agent.js +8 -1
- package/package.json +1 -1
package/bin/prior.js
CHANGED
|
@@ -1056,6 +1056,7 @@ Keep it under 350 words. Write prior.md now.`;
|
|
|
1056
1056
|
|
|
1057
1057
|
case 'text': {
|
|
1058
1058
|
spinStop();
|
|
1059
|
+
if (!ev.content) break;
|
|
1059
1060
|
const rendered = renderMarkdown(ev.content);
|
|
1060
1061
|
const thinkTime = elapsed(Date.now() - _thinkStart);
|
|
1061
1062
|
console.log(c.brand(' Prior ') + c.muted(`· ${timeNow()} · ${thinkTime}`));
|
package/lib/agent.js
CHANGED
|
@@ -198,8 +198,15 @@ async function runAgent({ messages, model, uncensored, cwd, projectContext, send
|
|
|
198
198
|
|
|
199
199
|
// ── No tool calls → final answer ──────────────────────────
|
|
200
200
|
if (calls.length === 0) {
|
|
201
|
+
const finalText = stripToolTags(cleaned);
|
|
202
|
+
if (!finalText && iter < MAX_ITER - 1) {
|
|
203
|
+
// Model returned blank (all think tags, no actual output) — nudge once
|
|
204
|
+
history.push({ role: 'assistant', content: raw });
|
|
205
|
+
history.push({ role: 'user', content: '(Your response was empty. Please write your reply.)' });
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
201
208
|
await trackTokenUsage(token, totalPromptTokens, totalCompletionTokens);
|
|
202
|
-
send({ type: 'text', content:
|
|
209
|
+
send({ type: 'text', content: finalText });
|
|
203
210
|
send({ type: 'done' });
|
|
204
211
|
return;
|
|
205
212
|
}
|