Skip to content

Add empty properties to GetIndexInfoRequest schema for OpenAI compatibility#96

Closed
mcthesw wants to merge 1 commit intobartolli:mainfrom
mcthesw:fix/openai-schema-missing-properties
Closed

Add empty properties to GetIndexInfoRequest schema for OpenAI compatibility#96
mcthesw wants to merge 1 commit intobartolli:mainfrom
mcthesw:fix/openai-schema-missing-properties

Conversation

@mcthesw
Copy link
Copy Markdown
Contributor

@mcthesw mcthesw commented Mar 19, 2026

GetIndexInfoRequest is the only empty struct deriving JsonSchema. schemars 1.2.1 generates {"type":"object"} for it — without a properties field. OpenAI's function calling API strictly rejects object schemas missing properties, which is why this only fails with OpenAI. (The image shows error in Copilot CLI when using GPT series LLM)

82a120eb73ffd9c3334751e94786ff7a

Fix: replace the derived JsonSchema with a manual impl that explicitly emits {"properties": {}}, and add a regression test.

de6361be5019e619c06ab9f779a25358

@bartolli
Copy link
Copy Markdown
Owner

Merged to main with emoji cleanup. Thanks @mcthesw

@bartolli bartolli closed this Mar 25, 2026
bartolli added a commit that referenced this pull request Mar 25, 2026
…nAI compatibility (#96)

Manual JsonSchema impl for GetIndexInfoRequest that emits properties:{}
and additionalProperties:false, satisfying both MCP spec and OpenAI's
strict function-calling validation.

Co-authored-by: Sworld <61224072+mcthesw@users.noreply.github.com>
bartolli added a commit that referenced this pull request Mar 25, 2026
- Remote embedding backend: OpenAI-compatible HTTP via CODANNA_EMBED_URL (PR #97)
- Bearer auth via CODANNA_EMBED_API_KEY env var (secrets not in config files)
- Dimension mismatch detection guards semantic index from silent replacement
- --force with CLI paths warns about configured roots that will not be rebuilt
- GetIndexInfoRequest schema includes properties:{} for OpenAI compatibility (PR #96)
- Nix flake for reproducible builds and nix run support (PR #94)
- Highlight range overlap panic fixed in document search
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.

2 participants