Bug description
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
Bug description
Every API request fails when using a strict-schema provider (observed with BYOK
opencode-go/ Console Go +deepseek-v4-flash/deepseek-v4-pro):Environment
opencode-go(Console Go); DeepSeek-family modelsRoot cause (from inspecting the shipped binary)
The
compute_jobtool's parameters are defined with zoddiscriminatedUnion("action", [...])(seecreateComputeJobTool). When serialized to an OpenAI-compatible tool schema the result has no top-leveltype: "object"(reported astype: 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 fromjsonSchema({properties:{}})/ unions missingtype: "object").Repro
opencode-go(Console Go) and select any deepseek modelcompute_jobschema is included in every request's tools arrayImpact
opencode-goor direct BYOK DeepSeek) are completely unusablecompute_jobis registered unconditionally (ComputeJobTool = createComputeJobTool()), so there is no config escape hatch (thetoolsconfig setting is rejected as unsupported)Suggested fix
type: "object"at the parameters root (patch the AI SDK jsonSchema conversion, e.g. addtype: "object"whenpropertiesis present)ComputeJobParametersfromdiscriminatedUnionto a plainz.objectwith a validatedactionenum, which serializes to a standard object schemaWorkarounds tested