@botbotgo/agent-harness 0.0.403 → 0.0.404

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.
@@ -13,7 +13,7 @@ spec:
13
13
  # LangChain aligned feature: concrete embedding model identifier passed to the provider integration.
14
14
  model: nomic-embed-text
15
15
  # LangChain aligned feature: provider-specific initialization options for embeddings.
16
- baseUrl: ${env:AGENT_HARNESS_OLLAMA_BASE_URL:-http://127.0.0.1:11434}
16
+ baseUrl: http://127.0.0.1:11434
17
17
 
18
18
  # ===================
19
19
  # DeepAgents Features
@@ -18,12 +18,12 @@ spec:
18
18
  provider: ollama
19
19
  # LangChain aligned feature: concrete model identifier passed to the selected provider integration.
20
20
  # Example values depend on `provider`, such as `gpt-oss:latest` for `ollama`.
21
- model: gemma4:e2b
21
+ model: granite4.1:3b
22
22
  # LangChain aligned feature: provider-specific initialization options.
23
23
  # Write these fields directly on the model object.
24
24
  # Common examples include `baseUrl`, `temperature`, and auth/client settings.
25
25
  # `baseUrl` configures the Ollama-compatible endpoint used by the model client.
26
26
  # For `openai-compatible`, `baseUrl` is normalized into the ChatOpenAI `configuration.baseURL` field.
27
- baseUrl: ${env:AGENT_HARNESS_OLLAMA_BASE_URL:-http://127.0.0.1:11434}
27
+ baseUrl: http://127.0.0.1:11434
28
28
  # LangChain aligned feature: provider/model initialization option controlling sampling temperature.
29
29
  temperature: 0.2
@@ -1,2 +1,2 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.403";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.404";
2
2
  export declare const AGENT_HARNESS_RELEASE_DATE = "2026-05-02";
@@ -1,2 +1,2 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.403";
1
+ export const AGENT_HARNESS_VERSION = "0.0.404";
2
2
  export const AGENT_HARNESS_RELEASE_DATE = "2026-05-02";
@@ -1,4 +1,5 @@
1
1
  import { salvageToolArgs } from "../../parsing/output-parsing.js";
2
+ import { salvageJsonToolCalls } from "../../parsing/output-tool-args.js";
2
3
  import { isRecord } from "../../../utils/object.js";
3
4
  import { extractExplicitResourceReferences, hasExplicitResourceReference } from "../../harness/system/runtime-memory-policy.js";
4
5
  function isObject(value) {
@@ -70,6 +71,44 @@ function mapSingleRemainingScalarArg(args, expectedKey) {
70
71
  [expectedKey]: value,
71
72
  };
72
73
  }
74
+ function readSchemaDescription(schemaPart) {
75
+ if (!isObject(schemaPart)) {
76
+ return "";
77
+ }
78
+ const direct = schemaPart.description;
79
+ if (typeof direct === "string") {
80
+ return direct;
81
+ }
82
+ const def = schemaPart._def;
83
+ if (typeof def?.description === "string") {
84
+ return def.description;
85
+ }
86
+ return readSchemaDescription(def?.innerType);
87
+ }
88
+ function fillLatestUserInputForQueryLikeFields(args, shape, latestUserInput) {
89
+ const userInput = typeof latestUserInput === "string" ? latestUserInput.trim() : "";
90
+ if (!userInput) {
91
+ return args;
92
+ }
93
+ let next = args;
94
+ for (const [key, schemaPart] of Object.entries(shape)) {
95
+ if (key in next) {
96
+ continue;
97
+ }
98
+ const normalizedKey = key.trim().toLowerCase();
99
+ const description = readSchemaDescription(schemaPart);
100
+ const keyIsQueryLike = ["query", "question", "prompt", "input", "text"].includes(normalizedKey);
101
+ const descriptionIsQueryLike = /\b(?:query|question|prompt|input|text)\b/iu.test(description);
102
+ if (!keyIsQueryLike && !descriptionIsQueryLike) {
103
+ continue;
104
+ }
105
+ next = {
106
+ ...next,
107
+ [key]: userInput,
108
+ };
109
+ }
110
+ return next;
111
+ }
73
112
  export function normalizeToolArgsForSchema(args, schema, rawArgsInput, options = {}) {
74
113
  const schemaDef = isObject(schema) ? schema._def : undefined;
75
114
  const zodShape = schemaDef
@@ -88,7 +127,7 @@ export function normalizeToolArgsForSchema(args, schema, rawArgsInput, options =
88
127
  }
89
128
  const keys = Object.keys(shape);
90
129
  if (keys.length !== 1) {
91
- return args;
130
+ return fillLatestUserInputForQueryLikeFields(args, shape, options.latestUserInput);
92
131
  }
93
132
  const [expectedKey] = keys;
94
133
  if (expectedKey in args) {
@@ -126,7 +165,7 @@ export function extractToolCallsFromResult(result) {
126
165
  : Array.isArray(messageKwargs?.tool_calls)
127
166
  ? messageKwargs.tool_calls
128
167
  : [];
129
- return rawToolCalls
168
+ const extracted = rawToolCalls
130
169
  .map((toolCall) => {
131
170
  if (!isObject(toolCall)) {
132
171
  return null;
@@ -149,4 +188,33 @@ export function extractToolCallsFromResult(result) {
149
188
  return { id, name, args: rawArgs, rawArgsInput };
150
189
  })
151
190
  .filter((item) => item !== null);
191
+ if (extracted.length > 0) {
192
+ return extracted;
193
+ }
194
+ const directRole = typeof lastMessage.role === "string"
195
+ ? lastMessage.role.trim().toLowerCase()
196
+ : undefined;
197
+ const messageType = typeof lastMessage._getType === "function"
198
+ ? String(lastMessage._getType())
199
+ : undefined;
200
+ const constructorType = Array.isArray(lastMessage.id)
201
+ ? lastMessage.id.at(-1)
202
+ : undefined;
203
+ if (directRole === "tool" || messageType === "tool" || constructorType === "ToolMessage") {
204
+ return [];
205
+ }
206
+ const content = typeof lastMessage.content === "string"
207
+ ? lastMessage.content
208
+ : typeof messageKwargs?.content === "string"
209
+ ? messageKwargs.content
210
+ : "";
211
+ if (!content.trim()) {
212
+ return [];
213
+ }
214
+ return salvageJsonToolCalls(content).map((toolCall, index) => ({
215
+ id: `salvaged-json-${index + 1}`,
216
+ name: toolCall.name,
217
+ args: toolCall.args,
218
+ rawArgsInput: content,
219
+ }));
152
220
  }
@@ -420,12 +420,17 @@ function normalizeWriteTodosArgs(args) {
420
420
  ? record.content
421
421
  : typeof record.description === "string" && record.description.trim().length > 0
422
422
  ? record.description
423
- : `Step ${index + 1}`;
423
+ : typeof record.title === "string" && record.title.trim().length > 0
424
+ ? record.title
425
+ : typeof record.name === "string" && record.name.trim().length > 0
426
+ ? record.name
427
+ : typeof record.text === "string" && record.text.trim().length > 0
428
+ ? record.text
429
+ : `Step ${index + 1}`;
424
430
  const normalized = {};
425
431
  if (content !== undefined)
426
432
  normalized.content = content;
427
- if (typeof record.status === "string")
428
- normalized.status = record.status;
433
+ normalized.status = typeof record.status === "string" && record.status.trim().length > 0 ? record.status : "pending";
429
434
  return Object.keys(normalized).length > 0 ? normalized : todo;
430
435
  }),
431
436
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.403",
3
+ "version": "0.0.404",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",