agent-lattice 0.17.0 → 0.18.0

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/README.md CHANGED
@@ -140,10 +140,16 @@ const result = await agent.prompt("Solve this carefully.", {
140
140
 
141
141
  Use `{ type: "adaptive" }` for models that support adaptive thinking. Use
142
142
  `{ type: "enabled", budgetTokens }` for models that require a fixed budget, or
143
- `{ type: "disabled" }` to omit thinking from the provider request. A fixed
143
+ `{ type: "disabled" }` to turn thinking off. A fixed
144
144
  budget is capped at `maxTokens - 1` to satisfy the Anthropic API constraint.
145
145
  When omitted, the SDK does not send a thinking configuration.
146
146
 
147
+ `{ type: "disabled" }` is sent to the provider explicitly as
148
+ `thinking: { "type": "disabled" }` rather than omitted, because some
149
+ Anthropic-compatible providers (for example DeepSeek's
150
+ `https://api.deepseek.com/anthropic` endpoint) default thinking to on —
151
+ omitting the field would leave it enabled.
152
+
147
153
  For Kimi K3 through an Anthropic-compatible endpoint or gateway, use
148
154
  `reasoningEffort` to send the provider's top-level `reasoning_effort` parameter:
149
155
 
@@ -1295,6 +1301,13 @@ if (result.stop_reason === "max_tokens") {
1295
1301
  The SDK does not treat that as an error, so checking this field is the only way
1296
1302
  to distinguish a complete answer from a truncated one.
1297
1303
 
1304
+ When a response containing tool calls is truncated at `max_tokens`, the SDK
1305
+ does not execute those calls: the last `tool_use` input may be incomplete, and
1306
+ a truncated value can even survive JSON parsing with its meaning changed.
1307
+ Every call in the batch gets an error `tool_result` explaining the truncation
1308
+ and asking the model to reissue the call with a shorter output, and the loop
1309
+ continues. *Requires 0.18.0 or later.*
1310
+
1298
1311
  Usage comes from the model client. The built-in Anthropic client fills it in from
1299
1312
  the response, including the streaming path; a custom `ModelClient` that omits
1300
1313
  `usage` produces zeroed counts rather than an error.