Skip to content

[#303] 🐛 - Bugbot first message bugs#304

Merged
efraespada merged 9 commits intodevelopfrom
bugfix/303-bugbot-first-message-bugs
Feb 13, 2026
Merged

[#303] 🐛 - Bugbot first message bugs#304
efraespada merged 9 commits intodevelopfrom
bugfix/303-bugbot-first-message-bugs

Conversation

@efraespada
Copy link
Member

@efraespada efraespada commented Feb 13, 2026

📌 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 AnswerIssueHelpUseCase with 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:

    • New AnswerIssueHelpUseCase class to handle initial responses for question/help issues using OpenCode Plan agent
    • New prompt template answer_issue_help.ts with explicit instructions for direct, complete answers
    • Shared constant OPENCODE_PROJECT_CONTEXT_INSTRUCTION for consistent project context guidance across prompts
    • Comprehensive unit tests for both the prompt (answer_issue_help.test.ts) and use case (answer_issue_help_use_case.test.ts)
  • Updated:

    • IssueUseCase flow to route question/help issues to AnswerIssueHelpUseCase instead of RecommendStepsUseCase
    • prompts/index.ts to 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 AnswerIssueHelpUseCase runs only when:

  • Issue is newly opened (param.issue.opened)
  • Issue has question or help label
  • OpenCode is configured (model and server URL are set)
  • Issue has a non-empty body

The use case uses the Plan agent (OPENCODE_AGENT_PLAN) with JSON schema validation for consistent response formatting.


🔍 How to Test

  1. Create a new issue with the help or question label
  2. In the issue body, ask a question like "How can I implement this GitHub action? I need a tutorial"
  3. The bot should post an initial response that directly answers the question based on the project's README and docs, without saying it needs to explore first
  4. Verify the response includes concrete steps or guidance based on actual documentation

🧪 Test Coverage

  • Unit tests
  • Integration tests
  • End-to-end (E2E) tests
  • Manual testing only (explain why)

⚠️ Breaking Changes

  • None

🚀 Deployment Notes

  • Requires database migration
  • Requires environment variable changes
  • Requires feature flag toggle
  • No special deployment steps

🔒 Security Considerations

  • No security impact
  • Input validation changes
  • Authentication / authorization changes
  • Sensitive data handling changes

📈 Performance Impact

  • No performance impact
  • Improves performance
  • Potential performance regression (explain)

📝 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

  • I have self-reviewed my code
  • Code follows project standards and conventions
  • Tests have been added or updated
  • Documentation has been updated (if applicable)
  • No new warnings or lint errors
  • Changes are backward compatible or breaking changes are documented

📚 Additional Context

The issue reported that when creating a help issue asking for a tutorial, the bot responded with:

"I'd be happy to help you implement this GitHub Action! To provide you with the most relevant guidance, I need to understand what this project does. Let me first explore the repository structure and documentation to see what kind of GitHub Action this is."

This PR addresses that by:

  1. Creating a dedicated prompt that prohibits deferral language
  2. Explicitly requiring immediate, complete answers based on available context
  3. Using the Plan agent which is better suited for this type of contextual question-answering

…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'
@docs-page
Copy link

docs-page bot commented Feb 13, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/vypdev/copilot~304

Documentation is deployed and generated using docs.page.

@vypbot vypbot added the 100% Progress: 100% label Feb 13, 2026
@vypbot vypbot changed the title Bugfix/303 bugbot first message bugs [#303] 🐛 - Bugbot first message bugs Feb 13, 2026
@vypbot vypbot self-requested a review February 13, 2026 17:58
@vypbot vypbot added this to vypdev Feb 13, 2026
@efraespada efraespada enabled auto-merge February 13, 2026 17:58
@vypbot vypbot moved this to In Progress in vypdev Feb 13, 2026
@vypbot vypbot changed the base branch from develop to master February 13, 2026 17:58
@efraespada efraespada linked an issue Feb 13, 2026 that may be closed by this pull request
1 task
@vypbot vypbot changed the base branch from master to develop February 13, 2026 17:59
@vypbot vypbot added the size: XXL Indicates an extremely large task or issue that requires significant time and effort to complete. label Feb 13, 2026
@efraespada efraespada merged commit 7fd9052 into develop Feb 13, 2026
12 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in vypdev Feb 13, 2026
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 87.27273% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.82%. Comparing base (eb13c62) to head (19986d9).
⚠️ Report is 28 commits behind head on develop.

Files with missing lines Patch % Lines
src/data/repository/branch_compare_repository.ts 75.00% 8 Missing and 8 partials ⚠️
src/prompts/index.ts 77.27% 10 Missing ⚠️
src/data/repository/branch_repository.ts 65.00% 7 Missing ⚠️
src/data/repository/merge_repository.ts 89.85% 5 Missing and 2 partials ⚠️
src/data/repository/workflow_repository.ts 33.33% 2 Missing ⚠️
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     
Files with missing lines Coverage Δ
src/cli.ts 60.93% <100.00%> (+0.18%) ⬆️
src/data/repository/git_cli_repository.ts 100.00% <100.00%> (ø)
src/prompts/answer_issue_help.ts 100.00% <100.00%> (ø)
src/prompts/bugbot.ts 100.00% <100.00%> (ø)
src/prompts/bugbot_fix.ts 100.00% <100.00%> (ø)
src/prompts/bugbot_fix_intent.ts 100.00% <100.00%> (ø)
src/prompts/check_comment_language.ts 100.00% <100.00%> (ø)
src/prompts/check_progress.ts 100.00% <100.00%> (ø)
src/prompts/cli_do.ts 100.00% <100.00%> (ø)
src/prompts/fill.ts 100.00% <100.00%> (ø)
... and 20 more

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

blobUrl: file.blob_url,
rawUrl: file.raw_url,
contentsUrl: file.contents_url,
patch: file.patch,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@vypbot
Copy link
Contributor

vypbot commented Feb 13, 2026

🐛 Bugfix Actions

  1. The pull request's title was updated from Bugfix/303 bugbot first message bugs to [#303] 🐛 - Bugbot first message bugs.
  2. The pull request was assigned to @efraespada (creator).
  3. @vypbot was requested to review the pull request.
  4. The pull request was linked to vypdev and moved to the column In Progress.
  5. The base branch was temporarily updated to master.
  6. The description was temporarily modified to include a reference to issue 🐛🧑‍💻 - Bugbot first message bugs #303.
  7. The base branch was reverted to its original value: develop.
  8. The temporary issue reference 🐛🧑‍💻 - Bugbot first message bugs #303 was removed from the description.
  9. Priority set to P0 in vypdev.

image

🚀 Happy coding!

@vypbot
Copy link
Contributor

vypbot commented Feb 13, 2026

🐛 Bugfix Actions

  1. 🐛🧑‍💻 - Bugbot first message bugs #303 was automatically closed after merging this pull request.

image

🚀 Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

100% Progress: 100% size: XXL Indicates an extremely large task or issue that requires significant time and effort to complete.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛🧑‍💻 - Bugbot first message bugs

3 participants