Changesets · Branches · Tags · Compare
| Changeset | 1c3151d9ec31f366e997079c20b3a6484150197b46b477619b8705a3e1efb5e3 |
|---|---|
| Author | Ting-Wai <40179554+tingwai@users.noreply.github.com> · 2025-09-05 15:04 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-05 15:04 -07:00 |
| Parents | add90d1f38c6, a4ca36bd23ee |
2 files changed
modified .github/workflows/respond-to-cubic.yaml +41 −3
| @@ -172,21 +172,59 @@ | ||
| 172 | 172 | if: steps.check-mention.outputs.contains_mention == 'true' |
| 173 | 173 | run: npm i -g @continuedev/cli |
| 174 | 174 | |
| 175 | + - name: Get review context | |
| 176 | + if: steps.check-mention.outputs.contains_mention == 'true' | |
| 177 | + id: review-context | |
| 178 | + uses: actions/github-script@v7 | |
| 179 | + with: | |
| 180 | + script: | | |
| 181 | + let reviewContext = ''; | |
| 182 | + | |
| 183 | + // Check if this comment is a reply to another review comment | |
| 184 | + if (context.payload.comment.in_reply_to_id) { | |
| 185 | + try { | |
| 186 | + const { data: originalComment } = await github.rest.pulls.getReviewComment({ | |
| 187 | + owner: context.repo.owner, | |
| 188 | + repo: context.repo.repo, | |
| 189 | + comment_id: context.payload.comment.in_reply_to_id | |
| 190 | + }); | |
| 191 | + | |
| 192 | + reviewContext = `**Original review comment by @${originalComment.user.login}:** | |
| 193 | + ${originalComment.body} | |
| 194 | + | |
| 195 | + **Reply by @${{ github.event.comment.user.login }}:** | |
| 196 | + ${{ github.event.comment.body }}`; | |
| 197 | + } catch (error) { | |
| 198 | + console.log('Could not fetch original comment, using current comment only'); | |
| 199 | + reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** | |
| 200 | + ${{ github.event.comment.body }}`; | |
| 201 | + } | |
| 202 | + } else { | |
| 203 | + reviewContext = `**Review comment by @${{ github.event.comment.user.login }}:** | |
| 204 | + ${{ github.event.comment.body }}`; | |
| 205 | + } | |
| 206 | + | |
| 207 | + core.setOutput('context', reviewContext); | |
| 208 | + | |
| 175 | 209 | - name: Start remote session |
| 176 | 210 | if: steps.check-mention.outputs.contains_mention == 'true' |
| 177 | 211 | id: remote-session |
| 178 | 212 | env: |
| 179 | 213 | CONTINUE_API_KEY: ${{ secrets.CONTINUE_API_KEY }} |
| 180 | 214 | run: | |
| 215 | + # Debug: Echo the branch we're starting the session on | |
| 216 | + echo "Starting remote session on branch: ${{ github.event.pull_request.head.ref }}" | |
| 217 | + | |
| 181 | 218 | # Create a temporary file for the prompt to handle special characters and newlines properly |
| 182 | 219 | cat > /tmp/prompt.txt << 'PROMPT_EOF' |
| 183 | - Please help with the following code review comment from @${{ github.event.comment.user.login }} on PR #${{ github.event.pull_request.number }}: | |
| 220 | + Please help with the following code review discussion from PR #${{ github.event.pull_request.number }}: | |
| 184 | 221 | |
| 185 | 222 | **File:** ${{ github.event.comment.path }} |
| 186 | 223 | **Line:** ${{ github.event.comment.line || github.event.comment.original_line || 'N/A' }} |
| 187 | - **Comment:** ${{ github.event.comment.body }} | |
| 188 | 224 | |
| 189 | - Please analyze the specific file and line mentioned, understand the review feedback, implement the necessary changes, and commit them to this branch. | |
| 225 | + ${{ steps.review-context.outputs.context }} | |
| 226 | + | |
| 227 | + 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. | |
| 190 | 228 | PROMPT_EOF |
| 191 | 229 | |
| 192 | 230 | # Debug output |
modified extensions/cli/src/tools/runTerminalCommand.ts +1 −1
| @@ -33,7 +33,7 @@ | ||
| 33 | 33 | displayName: "Bash", |
| 34 | 34 | description: `Executes a terminal command and returns the output |
| 35 | 35 | |
| 36 | -The command will be executed from the current working directory: ${process.cwd()} | |
| 36 | +Commands are automatically executed from the current working directory (${process.cwd()}), so there's no need to change directories with 'cd' commands. | |
| 37 | 37 | `, |
| 38 | 38 | parameters: { |
| 39 | 39 | command: { |