Skip to content

feat: Add Zod-validated tools with error and max-steps coverage - #12

Open
ThomasHartDev wants to merge 1 commit into
mainfrom
thomas/feat/more-tools
Open

feat: Add Zod-validated tools with error and max-steps coverage#12
ThomasHartDev wants to merge 1 commit into
mainfrom
thomas/feat/more-tools

Conversation

@ThomasHartDev

Copy link
Copy Markdown
Owner

Tools now go through defineTool: a Zod schema is the source of truth, projected to JSON Schema for the LLM adapter and safeParse'd again when the model returns args. Invalid args and runtime throws land as tool-role messages so the turn keeps going; unknown names do the same. The loop still hard-stops at MAX_STEPS (overridable per turn), and vitest covers validation, division-by-zero, unknown tools, injected registries, and the step cap. Closes #11.

defineTool projects Zod schemas to JSON Schema for the LLM and re-checks
args at runtime. Validation failures and throws stay as tool messages so
the loop can recover, with a max-steps circuit breaker and tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent-core: Zod-validated tools with tool-error and max-steps test coverage

1 participant