Skip to content

fix(plugin): emit an object schema for empty-struct tool parameters - #72

Merged
sanchitrk merged 3 commits into
canaryfrom
claude/goofy-hawking-375742
Oct 13, 2026
Merged

sanchitrk merged 3 commits into
canaryfrom
claude/goofy-hawking-375742

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Summary

  • Tools with 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"}}.
  • toProviderJsonSchema in packages/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.
  • Bumps @codeworksh/plugin to 0.2.1 and adds an [Unreleased] changelog entry.

Test plan

  • New live E2E test packages/harness/test/tools.empty.live.test.ts against OpenAI (gpt-5.6-luna) and Anthropic (claude-sonnet-5-5), writing artifacts to __artifacts__/tools.empty.live.{openai,anthropic}.json.
  • Fails on both providers with the fix reverted and passes with it.
  • vp check and vp run typecheck pass.

Tag @codeworksh/plugin@0.2.1 is local only and not pushed yet.

🤖 Generated with Claude Code

sanchitrk and others added 3 commits October 13, 2026 14:47
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>
@sanchitrk
sanchitrk merged commit e288185 into canary Oct 13, 2026
2 checks passed
@sanchitrk
sanchitrk deleted the claude/goofy-hawking-375742 branch October 13, 2026 09:51
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.

1 participant