You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compute_job tool sends invalid JSON Schema (type: null) to strict providers like DeepSeek — every request fails #283
Every API request fails when using a strict-schema provider (observed with BYOK opencode-go / Console Go + deepseek-v4-flash / deepseek-v4-pro):
Error from provider (Console Go): Upstream request failed: [invalid_request_error] Invalid schema for function 'compute_job': schema must be a JSON Schema of 'type: "object"', got 'type: null'.
Environment
openscience version: 2.0.23 (latest, installed via npm @synsci/openscience)
OS: Linux (x64)
Provider: BYOK key on opencode-go (Console Go); DeepSeek-family models
Root cause (from inspecting the shipped binary)
The compute_job tool's parameters are defined with zod discriminatedUnion("action", [...]) (see createComputeJobTool). When serialized to an OpenAI-compatible tool schema the result has no top-level type: "object" (reported as type: null). Strict validators (DeepSeek official API, and proxies routing to it) reject the whole request — this is the same bug class as vercel/ai issue #7924 (tool schemas generated from jsonSchema({properties:{}}) / unions missing type: "object").
Repro
Add a BYOK key for opencode-go (Console Go) and select any deepseek model
Start any session in the Web UI / CLI
First provider call fails immediately with the error above — no tools are even invoked; the malformed compute_job schema is included in every request's tools array
Impact
DeepSeek-based models (via opencode-go or direct BYOK DeepSeek) are completely unusable
compute_job is registered unconditionally (ComputeJobTool = createComputeJobTool()), so there is no config escape hatch (the tools config setting is rejected as unsupported)
Suggested fix
Ensure every tool schema emitted to OpenAI-compatible endpoints has type: "object" at the parameters root (patch the AI SDK jsonSchema conversion, e.g. add type: "object" when properties is present)
Or convert ComputeJobParameters from discriminatedUnion to a plain z.object with a validated action enum, which serializes to a standard object schema
Workarounds tested
Switching to non-DeepSeek models (claude/gpt/gemini) avoids the error (they don't validate strictly)
No config option can disable the compute_job tool in 2.0.23
Activity
ping3839 commentedon Aug 13, 2026
I spent 10 hours today and finally finished the revisions.
stupidstupidstupidstupid commentedon Aug 16, 2026
the problem seems still remaining in 2.0.27
aayambansal commentedon Aug 18, 2026
Solved in #299. DeepSeek now gets object-rooted tool schemas, and runtime validation stays strict. Verified with provider regression tests.