[PR #13417] fix(opencode): preserve custom tool arg descriptions in LLM prompts #14656

Open
opened 2026-02-16 18:19:26 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13417

State: open
Merged: No


What does this PR do?

Fixes #4357

Custom tool .describe() metadata on args wasn't making it into the prompts sent to providers. prompt.ts was using z.toJSONSchema() to convert Zod schemas, but that method drops descriptions from dynamically imported schemas. experimental.ts already uses zodToJsonSchema() from zod-to-json-schema which handles this correctly — this just makes prompt.ts consistent.

How did you verify your code works?

bun typecheck passes. Confirmed the z.toJSONSchema call is gone and replaced with zodToJsonSchema which already works correctly in experimental.ts.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13417 **State:** open **Merged:** No --- ### What does this PR do? Fixes #4357 Custom tool `.describe()` metadata on args wasn't making it into the prompts sent to providers. `prompt.ts` was using `z.toJSONSchema()` to convert Zod schemas, but that method drops descriptions from dynamically imported schemas. `experimental.ts` already uses `zodToJsonSchema()` from `zod-to-json-schema` which handles this correctly — this just makes `prompt.ts` consistent. ### How did you verify your code works? `bun typecheck` passes. Confirmed the `z.toJSONSchema` call is gone and replaced with `zodToJsonSchema` which already works correctly in `experimental.ts`.
yindo added the pull-request label 2026-02-16 18:19:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14656