Skip to content

docs(ai): clarify tool failure modes and recovery limits - #8156

Open
danieljvdm wants to merge 2 commits into
Effect-TS:mainfrom
danieljvdm:docs/tool-failure-modes
Open

danieljvdm wants to merge 2 commits into
Effect-TS:mainfrom
danieljvdm:docs/tool-failure-modes

Conversation

@danieljvdm

@danieljvdm danieljvdm commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Declaring a tool's failure schema can look like enough to let an agent recover, but the default failureMode: "error" propagates typed failures and can end the calling model operation. Document that distinction at FailureMode, Tool.failureMode, and Tool.make, with an executable "return" example.

Clarify that Toolkit parameter validation follows the mode (as implemented in #7588), while defects, interruption, result encoding, unknown tool names, and validation outside Toolkit have different boundaries. Update the AI tools guide to match. This changes documentation only; it preserves the default and runtime behavior.

Validated with pnpm ai-docgen (no generated diff), pnpm lint-fix, pnpm jsdocs --check, pnpm lint, and pnpm doctest --run packages/effect/src/unstable/ai/Tool.ts (19 tests passed). Documentation-only changes do not require a changeset under the repository's contribution policy.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ed35c09

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 34.16 KB 34.16 KB 0.00 KB (0.00%)
basic.ts 6.87 KB 6.87 KB 0.00 KB (0.00%)
batching.ts 9.95 KB 9.95 KB 0.00 KB (0.00%)
brand.ts 6.45 KB 6.45 KB 0.00 KB (0.00%)
cache.ts 10.77 KB 10.77 KB 0.00 KB (0.00%)
config.ts 21.43 KB 21.43 KB 0.00 KB (0.00%)
differ.ts 20.23 KB 20.23 KB 0.00 KB (0.00%)
http-client.ts 21.93 KB 21.93 KB 0.00 KB (0.00%)
http-router.ts 33.39 KB 33.39 KB 0.00 KB (0.00%)
logger.ts 10.88 KB 10.88 KB 0.00 KB (0.00%)
metric.ts 9.02 KB 9.02 KB 0.00 KB (0.00%)
optic.ts 6.70 KB 6.70 KB 0.00 KB (0.00%)
pubsub.ts 15.10 KB 15.10 KB 0.00 KB (0.00%)
queue.ts 11.85 KB 11.85 KB 0.00 KB (0.00%)
schedule.ts 10.96 KB 10.96 KB 0.00 KB (0.00%)
schema-binary.ts 39.42 KB 39.42 KB 0.00 KB (0.00%)
schema-class.ts 19.98 KB 19.98 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 30.47 KB 30.47 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 26.25 KB 26.25 KB 0.00 KB (0.00%)
schema-string-transformation.ts 13.60 KB 13.60 KB 0.00 KB (0.00%)
schema-string.ts 11.08 KB 11.08 KB 0.00 KB (0.00%)
schema-template-literal.ts 15.36 KB 15.36 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 33.70 KB 33.70 KB 0.00 KB (0.00%)
schema-toCodeDocument.ts 24.51 KB 24.51 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 19.18 KB 19.18 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 19.32 KB 19.32 KB 0.00 KB (0.00%)
schema-toFormatter.ts 19.43 KB 19.43 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 23.69 KB 23.69 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 19.48 KB 19.48 KB 0.00 KB (0.00%)
schema.ts 19.18 KB 19.18 KB 0.00 KB (0.00%)
stm.ts 12.80 KB 12.80 KB 0.00 KB (0.00%)
stream.ts 9.83 KB 9.83 KB 0.00 KB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant