Repository navigation
fix(permissions): write Reasonix agent rules under spawn_agents too - #3814
Merged
Merged
Conversation
Reasonix studio-v2.58.0 replaced the task delegation family with a single spawn_agents tool, so an agent rule written only as `task` matched nothing there. Write every canonical agent rule under both `task` (1.x, v2 up to 2.57.x) and `spawn_agents` (2.58.0+); Reasonix only checks rule syntax, so the name the running build lacks is merely dormant. Import reads both back as `agent`, with the stricter action winning when they disagree. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7
spawn_agents is now a managed name, so a stricter task/spawn_agents entry written by hand is replaced on generate. Warn and list each replaced ask or deny entry that the generated lists make looser. Document the replacement, that pattern agent rules never match in Reasonix, and that the v2 Web UI editor refuses newly added unknown-tool rules. Add round-trip and mixed-spelling import tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7
Move the warning into its own helper to keep fromRulesyncPermissions under the complexity limit, and apply formatting. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7
Name the real source file and the raw override escape hatch in the warning, and compare entries in rulesync's spelling so `name(*)` matches the bare name. Cover a dropped pattern entry, a raw-kept deny and the `name(*)` spelling in tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7
…asonix-spawn-agents # Conflicts: # src/generated/docs-content.ts
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
Reasonix studio-v2.58.0 replaced the
taskdelegation family (task,read_only_task,parallel_tasks,fleet) with a singlespawn_agentstool (ad2c96347). rulesync wrote canonicalagentonly astask, and Reasonix matches rule tool names exactly, so on 2.58.0+ anagentask/deny matched nothing.Every
agentrule is now written under bothtaskandspawn_agents. Checked in the Reasonix source: permission lists are only checked for syntax (permrule.Parse,parseRuleson v1.39.11, studio-v2.57.0 and studio-v2.58.0). A rule that names a tool the running build lacks is skipped, and v2.34.0+ reports it as dormant, so neither the old nor the new line rejects the extra name.Changes
src/features/permissions/reasonix-permissions.ts: newCANONICAL_TO_EXTRA_REASONIX_TOOL_NAMES(agent→spawn_agents).agentrule under both names, and both count as managed, so stale copies are replaced.agent. When the two disagree, the stricter action wins (deny > ask > allow), so a hand-edited allow on one name cannot loosen a deny or ask on the other.spawn_agents(<glob>)rule never matches, because the call has no subject key (Reasonix: "A subject-specific rule cannot match a call that exposes no subject"). That is the same astask(<glob>)before this change.docs/reference/file-formats.mdReasonix permissions note, plus the regenerateddocs-content.ts.Verification
pnpm cicheck: green. All 614 test files pass, and the content checks pass once the change is committed.Refs #2599
🤖 Generated with Claude Code
https://claude.ai/code/session_01QUBBebviXSBQtiRAmDopZ7