Repository navigation
fix(plugin): emit an object schema for empty-struct tool parameters - #72
Merged
Merged
Conversation
Effect reads Schema.Struct({}) as TS {} and emits { not: { type: "null" } },
which OpenAI and Anthropic reject. Emit an empty object schema instead, with
the same additionalProperties as non-empty structs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parameters: Schema.Struct({})were rejected by OpenAI and Anthropic. Effect 4.0.1 reads an empty struct as the TypeScript{}type and emits{"not":{"type":"null"}}.toProviderJsonSchemainpackages/plugin/src/tool.ts, where every tool's parameters are converted for providers, now emits{"type":"object","properties":{},"additionalProperties":true}for a struct with no fields. That matches how non-empty structs are emitted.@codeworksh/pluginto 0.2.1 and adds an[Unreleased]changelog entry.Test plan
packages/harness/test/tools.empty.live.test.tsagainst OpenAI (gpt-5.6-luna) and Anthropic (claude-sonnet-5-5), writing artifacts to__artifacts__/tools.empty.live.{openai,anthropic}.json.vp checkandvp run typecheckpass.Tag
@codeworksh/plugin@0.2.1is local only and not pushed yet.🤖 Generated with Claude Code