@botbotgo/agent-harness 0.0.463 → 0.0.465

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.
@@ -574,11 +574,30 @@ function normalizeWriteTodosArgs(args) {
574
574
  const normalized = {};
575
575
  if (content !== undefined)
576
576
  normalized.content = content;
577
- normalized.status = typeof record.status === "string" && record.status.trim().length > 0 ? record.status : "pending";
577
+ normalized.status = normalizeWriteTodoStatus(record.status);
578
578
  return Object.keys(normalized).length > 0 ? normalized : todo;
579
579
  }),
580
580
  };
581
581
  }
582
+ function normalizeWriteTodoStatus(value) {
583
+ if (typeof value !== "string") {
584
+ return "pending";
585
+ }
586
+ const normalized = value.trim().toLowerCase().replace(/[\s-]+/gu, "_");
587
+ if (!normalized) {
588
+ return "pending";
589
+ }
590
+ if (normalized === "not_started" || normalized === "todo" || normalized === "open") {
591
+ return "pending";
592
+ }
593
+ if (normalized === "started" || normalized === "active" || normalized === "in_progress") {
594
+ return "in_progress";
595
+ }
596
+ if (normalized === "done" || normalized === "complete" || normalized === "completed") {
597
+ return "completed";
598
+ }
599
+ return normalized;
600
+ }
582
601
  function normalizeTaskArgs(args) {
583
602
  const description = typeof args.description === "string" && args.description.trim().length > 0
584
603
  ? args.description
@@ -1,4 +1,3 @@
1
- import { isLowSignalTodoContent } from "../adapter/runtime-adapter-support.js";
2
1
  import { extractReasoningText, extractVisibleOutput, hasToolCalls, readTextContent } from "./output-parsing.js";
3
2
  const MAX_STREAM_INLINE_TEXT_CHARS = 12_000;
4
3
  const STREAM_PREVIEW_TEXT_CHARS = 2_000;
@@ -205,31 +204,6 @@ function isErrorLikeToolOutput(value) {
205
204
  || /^command failed:/i.test(firstNonEmptyLine)
206
205
  || /^stderr:/i.test(firstNonEmptyLine);
207
206
  }
208
- function isEmptyInitialWriteTodosResult(value) {
209
- if (typeof value !== "object" || !value || Array.isArray(value)) {
210
- return false;
211
- }
212
- const typed = value;
213
- if (typeof typed.summary === "object" && typed.summary && Array.isArray(typed.summary.items)) {
214
- return (typed.summary.items).length === 0;
215
- }
216
- if (typeof typed.update === "object" && typed.update && Array.isArray(typed.update.todos)) {
217
- return (typed.update.todos).length === 0;
218
- }
219
- return false;
220
- }
221
- function hasLowSignalInitialWriteTodos(value) {
222
- if (typeof value !== "object" || !value || Array.isArray(value)) {
223
- return false;
224
- }
225
- const typed = value;
226
- const items = typeof typed.summary === "object" && typed.summary && Array.isArray(typed.summary.items)
227
- ? (typed.summary.items ?? [])
228
- : typeof typed.update === "object" && typed.update && Array.isArray(typed.update.todos)
229
- ? (typed.update.todos ?? [])
230
- : [];
231
- return items.length > 0 && items.every((item) => typeof item?.content === "string" && isLowSignalTodoContent(item.content));
232
- }
233
207
  function isToolMessageLike(value) {
234
208
  if (typeof value !== "object" || value === null) {
235
209
  return false;
@@ -326,12 +300,6 @@ export function extractToolResult(event) {
326
300
  const normalizedOutput = typeof rawOutput === "string"
327
301
  ? parseMaybeJson(rawOutput)
328
302
  : unwrapToolMessageOutput(rawOutput);
329
- if (!isToolError && toolName === "write_todos" && isEmptyInitialWriteTodosResult(normalizedOutput)) {
330
- throw new Error("Error invoking tool 'write_todos' with kwargs {\"todos\":[]} with error: Error: Initial write_todos call cannot use an empty todo list. Send the concrete task steps with both content and status.");
331
- }
332
- if (!isToolError && toolName === "write_todos" && hasLowSignalInitialWriteTodos(normalizedOutput)) {
333
- throw new Error("Error invoking tool 'write_todos' with placeholder todo content with error: Error: Initial write_todos call must use descriptive task content. Do not use placeholder entries like '1', '2', or 'step 1'.");
334
- }
335
303
  return {
336
304
  toolName,
337
305
  output: sanitizeStreamPayload(normalizedOutput),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.463",
3
+ "version": "0.0.465",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",