@holoscript/holoscript-agent 2.1.1 → 2.1.2

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/runner.js CHANGED
@@ -950,12 +950,18 @@ var AgentRunner = class {
950
950
  }
951
951
  if (productiveCallCount === 0 && toolsCalled.size > 0 && iters < MAX_TOOL_ITERS) {
952
952
  iters++;
953
+ if (messages.length > 0 && messages[messages.length - 1].role === "assistant") {
954
+ messages.pop();
955
+ }
953
956
  messages.push({
954
957
  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."
958
+ content: `You read data but did NOT call write_file. This is a TASK FAILURE unless you act now.
959
+ Task: ${target.title}
960
+ Required output path (from task description): ${target.description.match(/path[:\s]+([^\s\n,]+\.json)/i)?.[1] ?? "see task description"}
961
+ Call write_file NOW. Embed ALL data from the tool result above into the content. Do NOT output any text \u2014 your ONLY valid response is a write_file tool call.`
956
962
  });
957
963
  const reResp = await provider.complete(
958
- { messages, maxTokens: 8192, temperature: 0.4, tools: activeTools },
964
+ { messages, maxTokens: 8192, temperature: 0, tools: activeTools },
959
965
  identity.llmModel
960
966
  );
961
967
  aggUsage = {