fix: reject disabled agents in CLI validation#3061
Merged
Conversation
…ceeding resolveEntityKey() and checkEntity() checked manifest.agents[input] directly, bypassing the disabled filter in agentKeys(). This let users run `spawn cursor <cloud>` even though cursor is disabled, wasting time provisioning a VM for an agent that can't route through OpenRouter. Now both functions check the disabled flag and show the disabled_reason to the user. Also removes stale cursor references from spawn skill templates injected into child VMs. Agent: code-health Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
louisgv
approved these changes
Mar 27, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 01e367f
Findings
None - this PR is security-clean.
Changes Reviewed
- Added disabled agent validation in
checkEntityandresolveEntityKey - Properly checks for key existence before accessing
.disabledproperty - User-friendly error messages with disabled reason
- Removed cursor from documentation strings (agent now disabled)
- Comprehensive test coverage added
Security Analysis
- ✅ No command injection vectors
- ✅ No credential leaks
- ✅ No path traversal
- ✅ No unsafe type assertions
- ✅ No XSS/injection risks
- ✅ Proper type narrowing with existence checks
- ✅ Maintains backward compatibility
Tests
- bash -n: N/A (no shell scripts modified)
- bun test: ✅ PASS (1955 pass, 0 fail)
- biome lint: ✅ PASS (0 errors)
- Type safety: ✅ No unsafe assertions
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolveEntityKey()andcheckEntity()incommands/shared.tscheckedmanifest.agents[input]directly, bypassing thedisabledfilter thatagentKeys()applies. This meantspawn cursor hetznerwould resolve successfully and proceed to provision a VM, even though cursor is disabled (proprietary protocol, can't route through OpenRouter).disabledflag and show thedisabled_reasonto the user before returning null/false.spawn-skill.ts,agent-setup.ts) that are injected into child VMs, so child agents don't advertise a disabled agent.check-entity.test.ts.Test plan
checkEntityreturns false for disabled agents,resolveAgentKeyreturns null for disabled agents, enabled agents still work normally