From 3ca8a7b6369c3f1ac863cc180ef01f5ab1bb0dd4 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 4 Sep 2025 20:31:48 -0700 Subject: [PATCH 1/3] Handle review comment threads in GitHub workflow --- .github/workflows/respond-to-cubic.yaml | 41 +++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/workflows/respond-to-cubic.yaml b/.github/workflows/respond-to-cubic.yaml index 4be94e462..2f3da84bc 100644 --- a/.github/workflows/respond-to-cubic.yaml +++ b/.github/workflows/respond-to-cubic.yaml @@ -172,6 +172,40 @@ jobs: if: steps.check-mention.outputs.contains_mention == 'true' run: npm i -g @continuedev/cli + - name: Get review context + if: steps.check-mention.outputs.contains_mention == 'true' + id: review-context + uses: actions/github-script@v7 + with: + script: | + let reviewContext = ''; + + // Check if this comment is a reply to another review comment + if (context.payload.comment.in_reply_to_id) { + try { + const { data: originalComment } = await github.rest.pulls.getReviewComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.in_reply_to_id + }); + + reviewContext = `**Original review comment by @${originalComment.user.login}:** + ${originalComment.body} + + **Reply by @${{ github.event.comment.user.login }}:** + ${{ github.event.comment.body }}`; + } catch (error) { + console.log('Could not fetch original comment, using current comment only'); + reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** + ${{ github.event.comment.body }}`; + } + } else { + reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** + ${{ github.event.comment.body }}`; + } + + core.setOutput('context', reviewContext); + - name: Start remote session if: steps.check-mention.outputs.contains_mention == 'true' id: remote-session @@ -180,13 +214,14 @@ jobs: run: | # Create a temporary file for the prompt to handle special characters and newlines properly cat > /tmp/prompt.txt << 'PROMPT_EOF' - Please help with the following code review comment from @${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}: + Please help with the following code review discussion from PR #${{ github.event.pull_request.number }}: **File:** ${{ github.event.comment.path }} **Line:** ${{ github.event.comment.line || github.event.comment.original_line || 'N/A' }} - **Comment:** ${{ github.event.comment.body }} - Please analyze the specific file and line mentioned, understand the review feedback, implement the necessary changes, and commit them to this branch. + ${{ steps.review-context.outputs.context }} + + Please analyze the specific file and line mentioned, understand the review feedback and any discussion context, implement the necessary changes, and commit them to this branch. PROMPT_EOF # Debug output From 212cad2e351e789bffa23ca9a1ec90c6448a5f03 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 4 Sep 2025 20:34:13 -0700 Subject: [PATCH 2/3] echo branch for debuggng --- .github/workflows/respond-to-cubic.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/respond-to-cubic.yaml b/.github/workflows/respond-to-cubic.yaml index 2f3da84bc..d462b26ba 100644 --- a/.github/workflows/respond-to-cubic.yaml +++ b/.github/workflows/respond-to-cubic.yaml @@ -212,6 +212,9 @@ jobs: env: CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} run: | + # Debug: Echo the branch we're starting the session on + echo "Starting remote session on branch: ${{ github.event.pull_request.head.ref }}" + # Create a temporary file for the prompt to handle special characters and newlines properly cat > /tmp/prompt.txt << 'PROMPT_EOF' Please help with the following code review discussion from PR #${{ github.event.pull_request.number }}: From 50c6f90633b51025b9a82d7b6bd4b412dc56eb9c Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 5 Sep 2025 11:36:31 -0700 Subject: [PATCH 3/3] update Bash tool instructions --- extensions/cli/src/tools/runTerminalCommand.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cli/src/tools/runTerminalCommand.ts b/extensions/cli/src/tools/runTerminalCommand.ts index 58d3939e5..726c86501 100644 --- a/extensions/cli/src/tools/runTerminalCommand.ts +++ b/extensions/cli/src/tools/runTerminalCommand.ts @@ -33,7 +33,7 @@ export const runTerminalCommandTool: Tool = { displayName: "Bash", description: `Executes a terminal command and returns the output -The command will be executed from the current working directory: ${process.cwd()} +Commands are automatically executed from the current working directory (${process.cwd()}), so there's no need to change directories with 'cd' commands. `, parameters: { command: {