feat: add /agent-demote command and make grade optional#3
Conversation
…mote - Grade defaults to 'primary' when not specified - Fix empty string grade bug - Add /agent-demote command to quickly demote agents to subagent - Bump version to 0.5.1
Co-authored-by: fdematos <fdematos@users.noreply.github.com>
|
Now I have a complete picture of the changes. Here's my review: Pull Request Review: feat: add /agent-demote command and make grade optionalSummaryThe PR adds a convenient Code Quality: GoodStrengths:
Potential Issues1. Missing test coverage for the new default behavior The existing tests in
Recommendation: Add tests for the execute function's default grade behavior. Consider adding an integration-style test or at least a unit test for the trim/default logic. 2. Minor: Command file inconsistency In This is fine, but it relies on the LLM to interpret "if no grade is provided, use primary" - which should work but could be more explicit by saying "If $2 is empty or not provided, omit the grade parameter". Suggestions for Improvement1. Add validation for empty/whitespace-only name Currently, if someone calls const name = args.name?.trim()
const grade = args.grade?.trim() || "primary"
if (!name) {
return `Agent name is required`
}2. Consider adding a test for the default grade behavior // In agent-promote.test.ts
describe("default grade behavior", () => {
it("should treat empty string grade as primary after trim", () => {
const grade = " "
const result = grade?.trim() || "primary"
expect(result).toBe("primary")
})
})Build Status
VerdictApprove with minor suggestions. The code is functional, well-documented, and follows existing patterns. The suggestions above are minor improvements that could be addressed in a follow-up PR if desired. |
|
User opencode-agent[bot] does not have write permissions |

Summary
/agent-demotecommand as a shortcut to demote agents to subagent modegradeparameter optional in/agent-promote(defaults toprimary)Changes
command/agent-demote.mdcommand/agent-promote.mdsrc/tools/agent-promote.tsREADME.mdpackage.jsonUsage