Skip to content

Commit 62d4398

Browse files
committed
feature-296-bugbot-autofix: Implement logic to recommend steps or provide help on newly opened issues based on labels, enhancing issue handling capabilities.
1 parent faddf72 commit 62d4398

15 files changed

Lines changed: 858 additions & 99 deletions

.cursor/rules/architecture.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ alwaysApply: true
2424
| Shared flow | `src/actions/common_action.ts` | mainRun, waitForPreviousRuns, dispatch to use cases |
2525
| Use cases | `src/usecase/` | issue_use_case, pull_request_use_case, commit_use_case, single_action_use_case |
2626
| Single actions | `src/usecase/actions/` | check_progress, detect_errors, recommend_steps, think, initial_setup, create_release, create_tag, publish_github_action, deployed_action |
27-
| Steps (issue) | `src/usecase/steps/issue/` | check_permissions, close_not_allowed_issue, assign_members, update_title, update_issue_type, link_issue_project, check_priority_issue_size, prepare_branches, remove_issue_branches, remove_not_needed_branches, label_deploy_added, label_deployed_added, move_issue_to_in_progress |
27+
| Steps (issue) | `src/usecase/steps/issue/` | check_permissions, close_not_allowed_issue, assign_members, update_title, update_issue_type, link_issue_project, check_priority_issue_size, prepare_branches, remove_issue_branches, remove_not_needed_branches, label_deploy_added, label_deployed_added, move_issue_to_in_progress, answer_issue_help_use_case (question/help on open). On issue opened: RecommendStepsUseCase (non release/question/help) or AnswerIssueHelpUseCase (question/help). |
2828
| Steps (PR) | `src/usecase/steps/pull_request/` | update_title, assign_members (issue), assign_reviewers_to_issue, link_pr_project, link_pr_issue, sync_size_and_progress_from_issue, check_priority_pull_request_size, update_description (AI), close_issue_after_merging |
2929
| Steps (commit) | `src/usecase/steps/commit/` | notify commit, check size |
3030
| Steps (issue comment) | `src/usecase/steps/issue_comment/` | check_issue_comment_language (translation) |

build/cli/index.js

Lines changed: 205 additions & 27 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* When a question or help issue is newly opened, posts an initial helpful reply
3+
* based on the issue description (OpenCode Plan agent). The user can still
4+
* @mention the bot later for follow-up answers (ThinkUseCase).
5+
*/
6+
import { Execution } from '../../../data/model/execution';
7+
import { Result } from '../../../data/model/result';
8+
import { ParamUseCase } from '../../base/param_usecase';
9+
export declare class AnswerIssueHelpUseCase implements ParamUseCase<Execution, Result[]> {
10+
taskId: string;
11+
private aiRepository;
12+
private issueRepository;
13+
invoke(param: Execution): Promise<Result[]>;
14+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Shared instruction for every prompt we send to OpenCode about the project.
3+
* Tells the agent to read not only the code (respecting ignore patterns) but also
4+
* the repository documentation and defined rules, for a full picture and better decisions.
5+
*/
6+
export declare const OPENCODE_PROJECT_CONTEXT_INSTRUCTION = "**Important \u2013 use full project context:** In addition to reading the relevant code (respecting any file ignore patterns specified), read the repository documentation (e.g. README, docs/) and any defined rules or conventions (e.g. .cursor/rules, CONTRIBUTING, project guidelines). This gives you a complete picture of the project and leads to better decisions in both quality of reasoning and efficiency.";

build/github_action/index.js

Lines changed: 202 additions & 26 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* When a question or help issue is newly opened, posts an initial helpful reply
3+
* based on the issue description (OpenCode Plan agent). The user can still
4+
* @mention the bot later for follow-up answers (ThinkUseCase).
5+
*/
6+
import { Execution } from '../../../data/model/execution';
7+
import { Result } from '../../../data/model/result';
8+
import { ParamUseCase } from '../../base/param_usecase';
9+
export declare class AnswerIssueHelpUseCase implements ParamUseCase<Execution, Result[]> {
10+
taskId: string;
11+
private aiRepository;
12+
private issueRepository;
13+
invoke(param: Execution): Promise<Result[]>;
14+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Shared instruction for every prompt we send to OpenCode about the project.
3+
* Tells the agent to read not only the code (respecting ignore patterns) but also
4+
* the repository documentation and defined rules, for a full picture and better decisions.
5+
*/
6+
export declare const OPENCODE_PROJECT_CONTEXT_INSTRUCTION = "**Important \u2013 use full project context:** In addition to reading the relevant code (respecting any file ignore patterns specified), read the repository documentation (e.g. README, docs/) and any defined rules or conventions (e.g. .cursor/rules, CONTRIBUTING, project guidelines). This gives you a complete picture of the project and leads to better decisions in both quality of reasoning and efficiency.";

src/usecase/actions/recommend_steps_use_case.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ${OPENCODE_PROJECT_CONTEXT_INSTRUCTION}
6969
**Issue #${issueNumber} description:**
7070
${issueDescription}
7171
72-
Provide a numbered list of recommended steps. You can add brief sub-bullets per step if needed.`;
72+
Provide a numbered list of recommended steps in **markdown** (use headings, lists, code blocks for commands or snippets) so it is easy to read. You can add brief sub-bullets per step if needed.`;
7373

7474
logInfo(`🤖 Recommending steps using OpenCode Plan agent...`);
7575
const response = await this.aiRepository.askAgent(

0 commit comments

Comments
 (0)