-
Notifications
You must be signed in to change notification settings - Fork 0
fix openrouter binding #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Preview Deployments Ready!Your changes have been deployed to preview environments: 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 1 file
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="openrouter/server/tools/llm-binding.ts">
<violation number="1" location="openrouter/server/tools/llm-binding.ts:480">
P1: Empty input schema removes validation for required properties (`modelId`, `callOptions`) that the execute function depends on. This will cause runtime errors when these properties are missing from the context. Consider defining a proper schema that includes the required fields, or using the original `STREAM_BINDING.inputSchema`.</violation>
<violation number="2" location="openrouter/server/tools/llm-binding.ts:515">
P2: Empty output schema removes validation and creates a type mismatch with the return statement which casts to `GENERATE_BINDING.outputSchema`. The actual runtime output won't be validated against any schema.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| outputSchema: GENERATE_BINDING.outputSchema, | ||
| // inputSchema: GENERATE_BINDING.inputSchema, | ||
| inputSchema: z.object({}), | ||
| outputSchema: z.object({}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Empty output schema removes validation and creates a type mismatch with the return statement which casts to GENERATE_BINDING.outputSchema. The actual runtime output won't be validated against any schema.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At openrouter/server/tools/llm-binding.ts, line 515:
<comment>Empty output schema removes validation and creates a type mismatch with the return statement which casts to `GENERATE_BINDING.outputSchema`. The actual runtime output won't be validated against any schema.</comment>
<file context>
@@ -509,8 +510,9 @@ export const createLLMGenerateTool = (env: Env) =>
- outputSchema: GENERATE_BINDING.outputSchema,
+ // inputSchema: GENERATE_BINDING.inputSchema,
+ inputSchema: z.object({}),
+ outputSchema: z.object({}),
execute: async ({ context }) => {
const {
</file context>
| outputSchema: z.object({}), | |
| outputSchema: GENERATE_BINDING.outputSchema, |
| "Returns a streaming response for interactive chat experiences.", | ||
| inputSchema: STREAM_BINDING.inputSchema, | ||
| // inputSchema: STREAM_BINDING.inputSchema, | ||
| inputSchema: z.object({}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Empty input schema removes validation for required properties (modelId, callOptions) that the execute function depends on. This will cause runtime errors when these properties are missing from the context. Consider defining a proper schema that includes the required fields, or using the original STREAM_BINDING.inputSchema.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At openrouter/server/tools/llm-binding.ts, line 480:
<comment>Empty input schema removes validation for required properties (`modelId`, `callOptions`) that the execute function depends on. This will cause runtime errors when these properties are missing from the context. Consider defining a proper schema that includes the required fields, or using the original `STREAM_BINDING.inputSchema`.</comment>
<file context>
@@ -476,7 +476,8 @@ export const createLLMStreamTool = (env: Env) =>
"Returns a streaming response for interactive chat experiences.",
- inputSchema: STREAM_BINDING.inputSchema,
+ // inputSchema: STREAM_BINDING.inputSchema,
+ inputSchema: z.object({}),
execute: async ({ context }) => {
const {
</file context>
| inputSchema: z.object({}), | |
| inputSchema: STREAM_BINDING.inputSchema, |
Summary by cubic
Fix OpenRouter LLM tool bindings to prevent schema validation errors and unblock streaming and generate calls. We now import z from zod and use minimal schemas as placeholders.
Written for commit d20e64d. Summary will update on new commits.