Fix direct-mode projection of unconstrained MCP JSON Schema #378

Closed
nsaspy wants to merge 4 commits from fix/298-native-any-json-schema into main
Owner

Closes #298.

Auto-Dig direct-mode runs 33253273594 and 33253547556 both failed before the first provider call because MCP import can normalize unconstrained/union-ish fields to runtime type:any, while rlm_native_tool rejected any during OpenAI-compatible schema projection.

This change keeps runtime any as the internal representation but renders it as an unconstrained provider JSON Schema object (no literal type field), while preserving supported annotations/properties recursively.

Adds a focused regression proving an object argument property with type:any normalizes and projects without a type member.

Validation on the branch with SWI-Prolog 9.0.4:

  • test/rlm_native_tool_test.pl green
  • test/rlm_native_any_schema_test.pl green
  • test/load_all.pl green

The temporary patch workflow used to execute that validation was removed before opening this PR.

Closes #298. Auto-Dig direct-mode runs 33253273594 and 33253547556 both failed before the first provider call because MCP import can normalize unconstrained/union-ish fields to runtime `type:any`, while `rlm_native_tool` rejected `any` during OpenAI-compatible schema projection. This change keeps runtime `any` as the internal representation but renders it as an unconstrained provider JSON Schema object (no literal `type` field), while preserving supported annotations/properties recursively. Adds a focused regression proving an object argument property with `type:any` normalizes and projects without a `type` member. Validation on the branch with SWI-Prolog 9.0.4: - `test/rlm_native_tool_test.pl` green - `test/rlm_native_any_schema_test.pl` green - `test/load_all.pl` green The temporary patch workflow used to execute that validation was removed before opening this PR.
chore: remove temporary issue 298 patch workflow
Some checks failed
Tree-sitter FFI / Direct SWI-Prolog Tree-sitter FFI (pull_request) Successful in 4m9s
CI / REAL OpenRouter integration (pull_request) Has been skipped
Nix flake / Flake package and clean runtime load (pull_request) Failing after 7s
Clean SWI pack install / Install and load copied pack (pull_request) Successful in 1m32s
CI / Deterministic unit and load checks (pull_request) Failing after 2m5s
Paid OpenRouter / Pinned paid OpenRouter integration (pull_request) Failing after 2m13s
aaf474cd6b
nsaspy closed this pull request 2026-09-04 22:55:49 +00:00
Some checks failed
Tree-sitter FFI / Direct SWI-Prolog Tree-sitter FFI (pull_request) Successful in 4m9s
CI / REAL OpenRouter integration (pull_request) Has been skipped
Nix flake / Flake package and clean runtime load (pull_request) Failing after 7s
Clean SWI pack install / Install and load copied pack (pull_request) Successful in 1m32s
CI / Deterministic unit and load checks (pull_request) Failing after 2m5s
Paid OpenRouter / Pinned paid OpenRouter integration (pull_request) Failing after 2m13s

Pull request closed

Sign in to join this conversation.
No description provided.