[#303] 🐛 - Bugbot first message bugs#304
Conversation
…o utilize dedicated prompt generation functions for improved readability and maintainability. Update `BranchRepository` type definition to ensure consistent status options. Remove deprecated prompt building methods across various use cases.
…se cases to enhance readability and maintainability. Remove deprecated methods for building prompts in `CheckProgressUseCase` and `UpdatePullRequestDescriptionUseCase`. Update `BranchRepository` type definition for consistent status options.
…Repository`, `IssueRepository`, `ProjectRepository`, and `PullRequestRepository`. Implement new test cases for handling various response scenarios, including invalid JSON and label management. Improve test coverage for project details and user authentication methods.
…ory`, `ProjectRepository`, and `PullRequestRepository`. Add new test cases for handling error scenarios, including API failures and empty responses. Update `BranchRepository` type definition for consistent status options.
…delegate operations to focused repositories for improved testability. Introduce `BranchCompareRepository` for branch comparison and size categorization. Update type definitions for consistency across repository interfaces.
…s by adding unit tests for `formatBranchName` method and error handling in `createLinkedBranch`. Ensure comprehensive coverage for various input scenarios and error conditions.
…s by adding unit tests for edge cases in `formatBranchName` and enhancing error handling in `createLinkedBranch`. Ensure robust coverage for diverse input scenarios and error conditions.
…`MergeRepository`, and `PrepareBranchesUseCase` by adding scenarios for early returns based on release type and tag availability. Introduce new test cases for handling hotfix and release branch creation, ensuring comprehensive coverage for various edge cases and error conditions.
…new action name 'Copilot-Github_with_super_powers'
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #304 +/- ##
============================================
+ Coverage 71.32% 88.82% +17.50%
============================================
Files 118 134 +16
Lines 5806 5941 +135
Branches 1266 1272 +6
============================================
+ Hits 4141 5277 +1136
+ Misses 1326 250 -1076
- Partials 339 414 +75
🚀 New features to boost your workflow:
|
| blobUrl: file.blob_url, | ||
| rawUrl: file.raw_url, | ||
| contentsUrl: file.contents_url, | ||
| patch: file.patch, |
There was a problem hiding this comment.
Inconsistent nullish coalescing for patch field
Severity: low
Location: src/data/repository/branch_compare_repository.ts:87
In the map function for files (lines 78-88), most fields use nullish coalescing (?? 0) to provide default values, but the patch field at line 87 is assigned directly as patch: file.patch without a fallback. This creates inconsistency and potential undefined values.
Suggested fix:
Add nullish coalescing for patch field: patch: file.patch ?? '', or handle undefined explicitly
| repo, | ||
| headBranch, | ||
| baseBranch, | ||
| issueNumber: String(issueNumber), |
There was a problem hiding this comment.
Redundant String() conversion in build_bugbot_fix_prompt
Severity: low
Location: src/usecase/steps/commit/bugbot/build_bugbot_fix_prompt.ts:67
Line 67 has issueNumber: String(issueNumber) which is redundant since the issueNumber is already a string value passed to the function. This is inconsistent with the pattern in other parts of the codebase.
Suggested fix:
Remove the redundant String() conversion: change issueNumber: String(issueNumber) to just issueNumber
| repo: param.repo, | ||
| headBranch, | ||
| baseBranch, | ||
| issueNumber: String(param.issueNumber), |
There was a problem hiding this comment.
Redundant String() conversion in build_bugbot_prompt
Severity: low
Location: src/usecase/steps/commit/bugbot/build_bugbot_prompt.ts:38
Line 38 has issueNumber: String(param.issueNumber) which is redundant since param.issueNumber is already available as a string or number. This follows the same inconsistent pattern as other prompt files.
Suggested fix:
Remove the redundant String() conversion: change issueNumber: String(param.issueNumber) to issueNumber: String(param.issueNumber) or handle type properly at the param level
🐛 Bugfix Actions
🚀 Happy coding! |
🐛 Bugfix Actions
🚀 Happy coding! |


📌 Summary
Fixes the AI model's incomplete responses when users open question/help issues. Previously, the model would respond with placeholder messages like "I need to understand what this project does" instead of providing immediate, actionable help. This PR adds a dedicated
AnswerIssueHelpUseCasewith a refined prompt that explicitly instructs the AI to provide complete answers using available project context (README, docs/, code, .cursor/rules) without deferring exploration.🎯 Related Issues / Tickets
🧩 Scope of Changes
Added:
AnswerIssueHelpUseCaseclass to handle initial responses for question/help issues using OpenCode Plan agentanswer_issue_help.tswith explicit instructions for direct, complete answersOPENCODE_PROJECT_CONTEXT_INSTRUCTIONfor consistent project context guidance across promptsanswer_issue_help.test.ts) and use case (answer_issue_help_use_case.test.ts)Updated:
IssueUseCaseflow to route question/help issues toAnswerIssueHelpUseCaseinstead ofRecommendStepsUseCaseprompts/index.tsto export the new prompt and register it in the prompt registry🛠️ Technical Details
The core issue was that the AI model interpreted general "use project context" instructions as permission to defer answers ("Let me first explore..."). The fix adds an explicit constraint in the prompt: "Answer in this single response: Give a complete, direct answer. Do not reply that you need to explore the repository, read documentation first, or gather more information—use the project (README, docs/, code, .cursor/rules) to answer now."
The
AnswerIssueHelpUseCaseruns only when:param.issue.opened)questionorhelplabelThe use case uses the Plan agent (
OPENCODE_AGENT_PLAN) with JSON schema validation for consistent response formatting.🔍 How to Test
helporquestionlabel🧪 Test Coverage
🚀 Deployment Notes
🔒 Security Considerations
📈 Performance Impact
📝 Notes for Reviewers
The prompt explicitly instructs the AI not to defer exploration, which should resolve the reported issue where users received incomplete responses. The new use case follows the same pattern as other issue-related use cases in the codebase.
✅ Checklist
📚 Additional Context
The issue reported that when creating a
helpissue asking for a tutorial, the bot responded with:This PR addresses that by: