claude-issue-solver 1.24.0 → 1.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -152,6 +152,9 @@ async function reviewCommand(issueNumber) {
152
152
  catch {
153
153
  console.log(chalk_1.default.yellow('Could not fetch PR diff, Claude will review the files directly.'));
154
154
  }
155
+ // Check for bot token early to include in prompt
156
+ const botToken = (0, config_1.getBotToken)();
157
+ const ghCmd = botToken ? `GH_TOKEN=\${BOT_TOKEN} gh` : 'gh';
155
158
  // Build the review prompt
156
159
  const prompt = `You are reviewing PR #${prNumber} for issue #${issueNumber}: ${issue.title}
157
160
 
@@ -168,7 +171,33 @@ Review the code changes in this PR. Look for:
168
171
  6. Performance problems
169
172
 
170
173
  ## How to Leave Feedback
174
+ ${botToken ? `
175
+ **IMPORTANT: A bot token is configured. Use this prefix for ALL gh commands:**
176
+ \`\`\`bash
177
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ...
178
+ GH_TOKEN=\${BOT_TOKEN} gh pr comment ...
179
+ \`\`\`
180
+ The BOT_TOKEN environment variable is already set in this terminal.
171
181
 
182
+ You can use formal reviews (approve/request-changes):
183
+
184
+ \`\`\`bash
185
+ # Post suggestions as review comments
186
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ${prNumber} --comment --body "**File: path/to/file.ts**
187
+
188
+ Description of the issue...
189
+
190
+ \\\`\\\`\\\`suggestion
191
+ // Your suggested fix here
192
+ \\\`\\\`\\\`
193
+ "
194
+
195
+ # Final verdict
196
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ${prNumber} --approve --body "LGTM! Code looks good."
197
+ # OR
198
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ${prNumber} --request-changes --body "Please address the issues above."
199
+ \`\`\`
200
+ ` : `
172
201
  First, check if you can post formal reviews by running these commands:
173
202
  \`\`\`bash
174
203
  # Get PR author
@@ -211,7 +240,7 @@ Description of the issue...
211
240
  \\\`\\\`\\\`
212
241
  "
213
242
  \`\`\`
214
-
243
+ `}
215
244
  The \`suggestion\` code block creates a "Commit suggestion" button on GitHub.
216
245
 
217
246
  ## PR Diff
@@ -221,9 +250,8 @@ Start by examining the diff and the changed files, then provide your review.`;
221
250
  // Write prompt to a file
222
251
  const promptFile = path.join(worktreePath, '.claude-review-prompt.txt');
223
252
  fs.writeFileSync(promptFile, prompt);
224
- // Check for bot token
225
- const botToken = (0, config_1.getBotToken)();
226
- const botTokenEnv = botToken ? `export GH_TOKEN="${botToken}"` : '# No bot token configured';
253
+ // Bot token already fetched above
254
+ const botTokenEnv = botToken ? `export BOT_TOKEN="${botToken}"\nexport GH_TOKEN="${botToken}"` : '# No bot token configured';
227
255
  const botNote = botToken
228
256
  ? 'Using bot token for reviews (can approve/request changes)'
229
257
  : 'No bot token - using your account (may have limitations on own PRs)';
@@ -420,6 +448,8 @@ async function launchReviewForPR(pr, projectRoot, projectName) {
420
448
  issueBody = issue.body;
421
449
  }
422
450
  }
451
+ // Check for bot token
452
+ const botToken = (0, config_1.getBotToken)();
423
453
  // Build the review prompt
424
454
  const prompt = `You are reviewing PR #${pr.number}: ${pr.title}
425
455
  ${pr.issueNumber ? `\n## Related Issue #${pr.issueNumber}\n${issueBody}\n` : ''}
@@ -433,7 +463,33 @@ Review the code changes in this PR. Look for:
433
463
  6. Performance problems
434
464
 
435
465
  ## How to Leave Feedback
466
+ ${botToken ? `
467
+ **IMPORTANT: A bot token is configured. Use this prefix for ALL gh commands:**
468
+ \`\`\`bash
469
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ...
470
+ GH_TOKEN=\${BOT_TOKEN} gh pr comment ...
471
+ \`\`\`
472
+ The BOT_TOKEN environment variable is already set in this terminal.
473
+
474
+ You can use formal reviews (approve/request-changes):
475
+
476
+ \`\`\`bash
477
+ # Post suggestions as review comments
478
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ${pr.number} --comment --body "**File: path/to/file.ts**
479
+
480
+ Description of the issue...
481
+
482
+ \\\`\\\`\\\`suggestion
483
+ // Your suggested fix here
484
+ \\\`\\\`\\\`
485
+ "
436
486
 
487
+ # Final verdict
488
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ${pr.number} --approve --body "LGTM! Code looks good."
489
+ # OR
490
+ GH_TOKEN=\${BOT_TOKEN} gh pr review ${pr.number} --request-changes --body "Please address the issues above."
491
+ \`\`\`
492
+ ` : `
437
493
  First, check if you can post formal reviews by running these commands:
438
494
  \`\`\`bash
439
495
  # Get PR author
@@ -476,7 +532,7 @@ Description of the issue...
476
532
  \\\`\\\`\\\`
477
533
  "
478
534
  \`\`\`
479
-
535
+ `}
480
536
  The \`suggestion\` code block creates a "Commit suggestion" button on GitHub.
481
537
 
482
538
  ## PR Diff
@@ -486,9 +542,7 @@ Start by examining the diff and the changed files, then provide your review.`;
486
542
  // Write prompt to a file
487
543
  const promptFile = path.join(worktreePath, '.claude-review-prompt.txt');
488
544
  fs.writeFileSync(promptFile, prompt);
489
- // Check for bot token
490
- const botToken = (0, config_1.getBotToken)();
491
- const botTokenEnv = botToken ? `export GH_TOKEN="${botToken}"` : '# No bot token configured';
545
+ const botTokenEnv = botToken ? `export BOT_TOKEN="${botToken}"\nexport GH_TOKEN="${botToken}"` : '# No bot token configured';
492
546
  const botNote = botToken
493
547
  ? 'Using bot token for reviews (can approve/request changes)'
494
548
  : 'No bot token - using your account (may have limitations on own PRs)';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-issue-solver",
3
- "version": "1.24.0",
3
+ "version": "1.24.1",
4
4
  "description": "Automatically solve GitHub issues using Claude Code",
5
5
  "main": "dist/index.js",
6
6
  "bin": {