zyndo 0.2.0 → 0.2.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/dist/agentLoop.js +10 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/openai.js +1 -1
- package/package.json +1 -1
package/dist/agentLoop.js
CHANGED
|
@@ -41,8 +41,17 @@ export async function runAgentLoop(provider, tools, initialMessage, opts) {
|
|
|
41
41
|
const response = await provider.chat(messages, toolDefs, opts.systemPrompt);
|
|
42
42
|
messages.push({ role: 'assistant', content: response.content });
|
|
43
43
|
if (response.stopReason === 'end_turn' || response.stopReason === 'max_tokens') {
|
|
44
|
+
const output = extractText(response.content);
|
|
45
|
+
if (response.stopReason === 'max_tokens') {
|
|
46
|
+
// Deliverable was truncated by the provider's max_tokens cap. We still
|
|
47
|
+
// return the partial output (better than crashing the task) but surface
|
|
48
|
+
// a loud warning so sellers can see which tasks hit the ceiling.
|
|
49
|
+
process.stderr.write(`[zyndo-cli] WARNING: LLM hit max_tokens for task ${opts.taskId}. ` +
|
|
50
|
+
`Delivery length: ${output.length} chars. ` +
|
|
51
|
+
`The deliverable is likely truncated. Consider asking the buyer for a smaller scope.\n`);
|
|
52
|
+
}
|
|
44
53
|
deleteState(opts.taskId);
|
|
45
|
-
return { output
|
|
54
|
+
return { output, paused: false };
|
|
46
55
|
}
|
|
47
56
|
if (response.stopReason === 'tool_use') {
|
|
48
57
|
const toolCalls = response.content.filter((b) => b.type === 'tool_use');
|
package/dist/providers/openai.js
CHANGED