feat: add /agent-promote command for hot-reloading agent modes#2
feat: add /agent-promote command for hot-reloading agent modes#2
Conversation
Add new command to change plugin agent types (subagent/primary/all) at runtime without restarting OpenCode. Uses tui.showToast for notification and instance.dispose for config reload.
Fixes duplicate Authorization header error when OpenCode action tries to access the repository.
Co-authored-by: fdematos <fdematos@users.noreply.github.com>
|
Good, the build and tests pass. Now I have a complete picture. Let me provide my comprehensive review: Pull Request Review:
|
| Area | Status |
|---|---|
| Typecheck | ✅ Passes |
| Tests | ✅ 116/116 pass |
| Code style | ✅ Follows patterns |
| Documentation | ✅ Comprehensive |
| Test coverage | |
| Error handling |
Priority fixes:
- High - Add test file for
agent-promotetool - Medium - Add error handling around
dispose()call - Low - Consider removing hardcoded agent names from command docs
Extract core logic to agent-promote-core.ts for testability. Tests cover validation, grade types, and promotedAgents Map.
|
All 127 tests pass and typecheck succeeds. Now let me provide a comprehensive review. Pull Request Review:
|
| Area | Status |
|---|---|
| Typecheck | ✅ Passes |
| Tests | ✅ 127/127 pass |
| Code style | ✅ Follows existing patterns |
| Test coverage | ✅ Core logic covered |
| Documentation | ✅ Comprehensive |
| Error handling |
Recommendation: Approve with minor suggestions. The implementation is solid and follows the codebase conventions. The error handling improvements are nice-to-have but not blocking.
|
Now I have a complete picture. Let me provide my comprehensive review. Pull Request Review:
|
| Area | Status |
|---|---|
| Typecheck | ✅ Passes |
| Tests | ✅ 127/127 pass |
| Code style | ✅ Follows existing patterns |
| Test coverage | ✅ Core logic covered |
| Documentation | ✅ Comprehensive |
| Error handling |
Recommendation
Approve with minor suggestions. The implementation is solid and follows the codebase conventions. The error handling improvements are nice-to-have but not blocking. Consider separating the workflow changes into a separate PR for cleaner history.



Summary
Add new
/agent-promotecommand to change plugin agent types at runtime without restarting OpenCode.Changes
agent-promoteinsrc/tools/agent-promote.tscommand/agent-promote.mdUsage
How it works
instance.dispose()to reload configconfigreads Map and overrides agent mode