From fcd9b83ff00525b8f6da2045d66d117abda5d9f0 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 7 Aug 2025 21:10:12 -0400 Subject: [PATCH 1/3] fix: build without vitest.setup.js --- tsconfig.build.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.build.json b/tsconfig.build.json index 01b072169..3d549c7da 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,5 +1,6 @@ { "extends": "./tsconfig.json", + "include": ["src/**/*"], "exclude": [ "src/**/*.test.ts", "src/**/*.test.tsx", From 5f5a73a291b68f0cb269742de924cfd7b19e0d66 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 7 Aug 2025 21:22:46 -0400 Subject: [PATCH 2/3] fix: include items in tool definitions for arrays --- src/streamChatResponse.ts | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/streamChatResponse.ts b/src/streamChatResponse.ts index 50b1b8336..a38296beb 100644 --- a/src/streamChatResponse.ts +++ b/src/streamChatResponse.ts @@ -21,8 +21,8 @@ import type { ToolPermissionServiceState } from "./services/ToolPermissionServic import { telemetryService } from "./telemetry/telemetryService.js"; import { calculateTokenCost } from "./telemetry/utils.js"; import { - getAllBuiltinTools, executeToolCall, + getAllBuiltinTools, getAvailableTools, Tool, ToolCall, @@ -38,7 +38,6 @@ import { logger } from "./util/logger.js"; dotenv.config(); export function getAllTools() { - // Get all available tool names const allBuiltinTools = getAllBuiltinTools(); const builtinToolNames = allBuiltinTools.map((tool) => tool.name); @@ -52,18 +51,25 @@ export function getAllTools() { const serviceResult = getServiceSync( SERVICE_NAMES.TOOL_PERMISSIONS ); - + let allowedToolNames: string[]; - if (serviceResult.state === 'ready' && serviceResult.value) { + if (serviceResult.state === "ready" && serviceResult.value) { // Filter out excluded tools based on permissions - allowedToolNames = filterExcludedTools(allToolNames, serviceResult.value.permissions); + allowedToolNames = filterExcludedTools( + allToolNames, + serviceResult.value.permissions + ); } else { // Service not ready - this is a critical error since tools should only be // requested after services are properly initialized - logger.error("ToolPermissionService not ready in getAllTools - this indicates a service initialization timing issue"); - throw new Error("ToolPermissionService not initialized. Services must be initialized before requesting tools."); + logger.error( + "ToolPermissionService not ready in getAllTools - this indicates a service initialization timing issue" + ); + throw new Error( + "ToolPermissionService not initialized. Services must be initialized before requesting tools." + ); } - + const allowedToolNamesSet = new Set(allowedToolNames); // Filter builtin tools @@ -81,7 +87,11 @@ export function getAllTools() { properties: Object.fromEntries( Object.entries(tool.parameters).map(([key, param]) => [ key, - { type: param.type, description: param.description }, + { + type: param.type, + description: param.description, + items: param.items, + }, ]) ), required: Object.entries(tool.parameters) From 22aa2f7784393f5e95f426ad4d7aa3268268fd75 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 7 Aug 2025 21:30:35 -0400 Subject: [PATCH 3/3] acknowledge cubic ai comments --- .github/workflows/respond-to-cubic-dev-ai.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/respond-to-cubic-dev-ai.yml diff --git a/.github/workflows/respond-to-cubic-dev-ai.yml b/.github/workflows/respond-to-cubic-dev-ai.yml new file mode 100644 index 000000000..750ec7de3 --- /dev/null +++ b/.github/workflows/respond-to-cubic-dev-ai.yml @@ -0,0 +1,59 @@ +name: Respond to cubic-dev-ai Comments + +on: + issue_comment: + types: [created] + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + respond-to-comment: + # Only run on pull request comments + if: github.event.issue.pull_request + runs-on: ubuntu-latest + + steps: + - name: Check if comment is from cubic-dev-ai + id: check-author + run: | + if [ "${{ github.event.comment.user.login }}" = "cubic-dev-ai" ]; then + echo "is_cubic_dev_ai=true" >> $GITHUB_OUTPUT + else + echo "is_cubic_dev_ai=false" >> $GITHUB_OUTPUT + fi + + - name: Get comment content + if: steps.check-author.outputs.is_cubic_dev_ai == 'true' + id: comment-content + run: | + # Store the comment body for debugging/logging + echo "Comment from cubic-dev-ai:" + echo "${{ github.event.comment.body }}" + + - name: Respond to cubic-dev-ai comment + if: steps.check-author.outputs.is_cubic_dev_ai == 'true' + uses: actions/github-script@v7 + with: + script: | + const commentBody = `👋 Thanks for the feedback, @cubic-dev-ai! + + I've received your comment: + > ${{ github.event.comment.body }} + + Your input has been acknowledged and will be reviewed by the team.`; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: commentBody + }); + + - name: Log acknowledgement + if: steps.check-author.outputs.is_cubic_dev_ai == 'true' + run: | + echo "✅ Successfully acknowledged comment from cubic-dev-ai on PR #${{ github.event.issue.number }}" + echo "Original comment: ${{ github.event.comment.body }}" \ No newline at end of file