Skip to content

Commit c59eb4e

Browse files
committed
feat: route /strands review command to reviewer mode
1 parent f522d5a commit c59eb4e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/scripts/javascript/process-inputs.cjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ function buildPrompts(mode, issueId, isPullRequest, command, branchName, inputs)
7474
inputs.session_id ||
7575
(mode === 'implementer' ? `${mode}-${branchName}`.replace(/[\/\\]/g, '-') : `${mode}-${issueId}`);
7676

77-
const scriptFile =
78-
mode === 'implementer' ? '.github/agent-sops/task-implementer.sop.md' : '.github/agent-sops/task-refiner.sop.md';
77+
const sopFiles = {
78+
implementer: '.github/agent-sops/task-implementer.sop.md',
79+
reviewer: '.github/agent-sops/task-reviewer.sop.md',
80+
refiner: '.github/agent-sops/task-refiner.sop.md',
81+
};
82+
const scriptFile = sopFiles[mode] || sopFiles.refiner;
7983

8084
const systemPrompt = fs.readFileSync(scriptFile, 'utf8');
8185

@@ -90,7 +94,11 @@ module.exports = async (context, github, core, inputs) => {
9094
const { issueId, command, issue } = await getIssueInfo(github, context, inputs);
9195

9296
const isPullRequest = !!issue.data.pull_request;
93-
const mode = isPullRequest || command.startsWith('implement') ? 'implementer' : 'refiner';
97+
const mode = command.startsWith('review')
98+
? 'reviewer'
99+
: isPullRequest || command.startsWith('implement')
100+
? 'implementer'
101+
: 'refiner';
94102
console.log(`Is PR: ${isPullRequest}, Mode: ${mode}`);
95103

96104
const branchName = await determineBranch(github, context, issueId, mode, isPullRequest);

0 commit comments

Comments
 (0)