@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.
@@ -1188,12 +1188,18 @@ var AgentRunner = class {
1188
1188
  }
1189
1189
  if (productiveCallCount === 0 && toolsCalled.size > 0 && iters < MAX_TOOL_ITERS) {
1190
1190
  iters++;
1191
+ if (messages.length > 0 && messages[messages.length - 1].role === "assistant") {
1192
+ messages.pop();
1193
+ }
1191
1194
  messages.push({
1192
1195
  role: "user",
1193
- 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."
1196
+ content: `You read data but did NOT call write_file. This is a TASK FAILURE unless you act now.
1197
+ Task: ${target.title}
1198
+ Required output path (from task description): ${target.description.match(/path[:\s]+([^\s\n,]+\.json)/i)?.[1] ?? "see task description"}
1199
+ 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.`
1194
1200
  });
1195
1201
  const reResp = await provider.complete(
1196
- { messages, maxTokens: 8192, temperature: 0.4, tools: activeTools },
1202
+ { messages, maxTokens: 8192, temperature: 0, tools: activeTools },
1197
1203
  identity.llmModel
1198
1204
  );
1199
1205
  aggUsage = {