Skip to content

Fix CLI warnings #7275

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Fix CLI warnings #7275

wants to merge 11 commits into from

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented Aug 21, 2025

This solves the npm warn deprecated [email protected]: Use your platform's native DOMException instead error that was showing up due to a dependency in openai version 4 by bumping to version 5. A few type guards were required to handle the new openai types safely. It also adds a few files to .npmignore.

@sestinj sestinj requested a review from a team as a code owner August 21, 2025 03:03
@sestinj sestinj requested review from tomasz-stefaniak and removed request for a team August 21, 2025 03:03
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 21, 2025
Copy link

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 9 files

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@@ -145,6 +145,11 @@ function convertJsonSchemaToGeminiSchema(jsonSchema: any): GeminiObjectSchema {
export function convertOpenAIToolToGeminiFunction(
tool: ChatCompletionTool,
): GeminiToolFunctionDeclaration {
// Type guard for function tools
if (tool.type !== "function" || !("function" in tool)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guard should verify that tool.function is defined, not just that the property name exists

Prompt for AI agents
Address the following comment on packages/openai-adapters/src/util/gemini-types.ts at line 149:

<comment>Guard should verify that tool.function is defined, not just that the property name exists</comment>

<file context>
@@ -145,6 +145,11 @@ function convertJsonSchemaToGeminiSchema(jsonSchema: any): GeminiObjectSchema {
 export function convertOpenAIToolToGeminiFunction(
   tool: ChatCompletionTool,
 ): GeminiToolFunctionDeclaration {
+  // Type guard for function tools
+  if (tool.type !== &quot;function&quot; || !(&quot;function&quot; in tool)) {
+    throw new Error(`Unsupported tool type: ${tool.type}`);
+  }
</file context>
Suggested change
if (tool.type !== "function" || !("function" in tool)) {
if (tool.type !== "function" || !tool.function) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant