anomalyco / anomalyco/opencode

[FEATURE]: Let tools opt into strict mode

Open
#40,214 0 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 3, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

A tool can't ask for strict mode. session/llm/request.ts hardcodes strict: false for @ai-sdk/openai, @ai-sdk/azure and @ai-sdk/amazon-bedrock/mantle and leaves it unset everywhere else, so there's no way to turn it on where the provider does support it.

The plumbing already exists — strict?: boolean is a documented field on the AI SDK Tool type, @ai-sdk/amazon-bedrock forwards it into toolSpec.strict, and Bedrock's Converse API enforces it. There's also a TODO for this at packages/llm/src/protocols/openai-responses.ts:264.

Concretely: I have a custom .opencode/tool that takes nested objects, and the model keeps sending table instead of tableName. The tool rejects it and the turn is spent on a retry. Strict mode makes those calls unemittable.

Happy to send a PR: strict?: boolean on the tool definition and the tool.definition hook, leaving the existing strict: false override alone.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.