agent-lattice 0.24.0 → 0.25.1
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 +17 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -544,6 +544,15 @@ The structure is enforced by the harness, not by prompt discipline:
|
|
|
544
544
|
- The name is reserved: registering your own `submit_output` tool while
|
|
545
545
|
`outputSchema` is set throws from `createAgent`/`addTools`.
|
|
546
546
|
|
|
547
|
+
By default a valid submission ends the run immediately — the bounded, cheapest
|
|
548
|
+
behavior for schema-delivering workers. For human-facing sessions that should
|
|
549
|
+
close with a natural-language summary, set `submitOutputEndTurn: false`: the
|
|
550
|
+
submission is recorded (re-submitting revises it, last one wins), the tool
|
|
551
|
+
result goes back to the model, and the run ends when the model stops. A text
|
|
552
|
+
ending after a submission succeeds with the last submission as
|
|
553
|
+
`structuredResult`; ending without any submission still fails with
|
|
554
|
+
`error_missing_output`. *Requires 0.25.0 or later.*
|
|
555
|
+
|
|
547
556
|
Unlike `outputFormat` (which relies on the provider's
|
|
548
557
|
`response_format`/`json_schema` support — DeepSeek ignores it, see
|
|
549
558
|
[Provider Compatibility](https://docs.claude-code-sdk.com/reference/provider-compatibility/)),
|
|
@@ -1645,3 +1654,11 @@ returns. Both fields are optional and absent when the client does not report
|
|
|
1645
1654
|
them.
|
|
1646
1655
|
|
|
1647
1656
|
*Requires 0.16.0 or later.*
|
|
1657
|
+
|
|
1658
|
+
## Invalid tool argument JSON
|
|
1659
|
+
|
|
1660
|
+
*Requires 0.25.1 or later.*
|
|
1661
|
+
|
|
1662
|
+
When a completed Anthropic-compatible stream contains malformed tool argument JSON, the SDK does not execute the tool. It returns a matching `tool_result` with `is_error: true`, identifies the JSON syntax problem (including a character position when available), lists required top-level fields, and asks the model to regenerate complete arguments from the tool schema. Raw argument excerpts are not echoed in the error.
|
|
1663
|
+
|
|
1664
|
+
Incomplete intermediate chunks are not errors if the final JSON is valid. Valid JSON objects, including `{}`, still go through normal schema validation. Valid JSON values that are not objects are rejected before execution. Existing turn limits still apply; this feedback does not guarantee that a model will correct its response.
|
package/dist/index.d.ts
CHANGED
|
@@ -603,6 +603,19 @@ export type AgentOptions<TContext = unknown> = {
|
|
|
603
603
|
* with the same name throws).
|
|
604
604
|
*/
|
|
605
605
|
outputSchema?: OutputSchema;
|
|
606
|
+
/**
|
|
607
|
+
* Whether a validated `submit_output` call ends the run. Only meaningful with
|
|
608
|
+
* `outputSchema`; default `true` — submitting finishes the run immediately
|
|
609
|
+
* with subtype "success", the bounded and cheapest behavior for
|
|
610
|
+
* schema-delivering workers. Set `false` to keep the loop going after a
|
|
611
|
+
* submission (e.g. human-facing sessions that should close with a
|
|
612
|
+
* natural-language summary): the submission is recorded — re-submitting
|
|
613
|
+
* revises it, last one wins — the tool result goes back to the model, and
|
|
614
|
+
* the run ends when the model stops. A text ending after a submission
|
|
615
|
+
* succeeds with the last submission as `SDKResultMessage.structuredResult`;
|
|
616
|
+
* ending without any submission still fails with `error_missing_output`.
|
|
617
|
+
*/
|
|
618
|
+
submitOutputEndTurn?: boolean;
|
|
606
619
|
/** Lifecycle callbacks that rewrite tool results and outgoing model requests. */
|
|
607
620
|
hooks?: AgentHooks<TContext>;
|
|
608
621
|
/**
|