@holoscript/holoscript-agent 2.1.0 → 2.1.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/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/dist/runner.js +31 -0
- package/dist/runner.js.map +1 -1
- package/dist/supervisor.js +31 -0
- package/dist/supervisor.js.map +1 -1
- package/package.json +1 -1
package/dist/runner.js
CHANGED
|
@@ -948,6 +948,37 @@ var AgentRunner = class {
|
|
|
948
948
|
finalText = resp.content;
|
|
949
949
|
break;
|
|
950
950
|
}
|
|
951
|
+
if (productiveCallCount === 0 && toolsCalled.size > 0 && iters < MAX_TOOL_ITERS) {
|
|
952
|
+
iters++;
|
|
953
|
+
messages.push({
|
|
954
|
+
role: "user",
|
|
955
|
+
content: "You gathered data but did not write the task deliverable. Call write_file NOW with the exact output path from the task description. Embed all data you gathered into the write_file content field. Do NOT output text \u2014 your only valid response is a write_file tool call."
|
|
956
|
+
});
|
|
957
|
+
const reResp = await provider.complete(
|
|
958
|
+
{ messages, maxTokens: 8192, temperature: 0.4, tools: activeTools },
|
|
959
|
+
identity.llmModel
|
|
960
|
+
);
|
|
961
|
+
aggUsage = {
|
|
962
|
+
promptTokens: aggUsage.promptTokens + reResp.usage.promptTokens,
|
|
963
|
+
completionTokens: aggUsage.completionTokens + reResp.usage.completionTokens,
|
|
964
|
+
totalTokens: aggUsage.totalTokens + reResp.usage.totalTokens
|
|
965
|
+
};
|
|
966
|
+
if (reResp.finishReason === "tool_use" && reResp.toolUses && reResp.toolUses.length > 0) {
|
|
967
|
+
log({ ev: "reprompt-tool-call", taskId: target.id, iter: iters, tools: reResp.toolUses.map((t) => t.name) });
|
|
968
|
+
const reProd = summarizeToolProductivity(reResp.toolUses);
|
|
969
|
+
for (const n of reProd.names) toolsCalled.add(n);
|
|
970
|
+
productiveCallCount += reProd.productiveCount;
|
|
971
|
+
messages.push({ role: "assistant", content: reResp.assistantBlocks ?? [] });
|
|
972
|
+
const reResults = await Promise.all(
|
|
973
|
+
reResp.toolUses.map(
|
|
974
|
+
(u) => runTool(u, { signReceipt: this.opts.signReceipt, addTask: (tasks2) => mesh.addTasks(tasks2) })
|
|
975
|
+
)
|
|
976
|
+
);
|
|
977
|
+
messages.push({ role: "user", content: reResults });
|
|
978
|
+
}
|
|
979
|
+
finalText = reResp.content;
|
|
980
|
+
lastResponse = reResp;
|
|
981
|
+
}
|
|
951
982
|
const durationMs = Date.now() - start;
|
|
952
983
|
if (productiveCallCount === 0) {
|
|
953
984
|
log({
|