fix(acp): advertise permissionModes capability + handle set_permission_mode#197
Merged
Merged
Conversation
…n_mode Advertise loopal's 3 permission modes (bypass/ask_dangerous/ask_any_write) in the initialize response's agentsmeshExtensions so the AgentsMesh permission selector renders loopal's own modes instead of leaking Claude Code's 4-mode set. Map the set_permission_mode control subtype to PermissionModeSwitch; the runtime path (input_control_config -> PermissionMode::from_str) is already wired.
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.
Problem
AgentsMesh's workspace permission selector hardcoded Claude Code's 4 modes
(bypassPermissions/acceptEdits/default/dontAsk) and sent them to every ACP agent.
loopal only accepts bypass/ask_dangerous/ask_any_write, so the selector was
semantically wrong and non-functional for loopal pods — Claude Code's permission
rules leaked into loopal's control surface.
Fix (loopal side)
adapter/lifecycle.rs: advertiseagentsmeshExtensions.permissionModes["bypass","ask_dangerous","ask_any_write"]in the initialize response(mirrors feat(acp): AgentsMesh _loopal/* control-panel extension #195's
controlRequest), so AgentsMesh renders loopal's modes.adapter/control_command.rs: map theset_permission_modecontrol subtype toControlCommand::PermissionModeSwitch. Runtime path(
input_control_config→PermissionMode::from_str) already wired.AgentsMesh side (separate change)
Runner parses the capability + forwards via session snapshot; core stores
supported_permission_modeswith a merge guard; web selector renders theadvertised modes dynamically (Claude fallback for agents that don't advertise).
Test
control_command.rs:set_permission_mode→PermissionModeSwitch; missing mode → Nonelifecycle.rs: initialize advertises bothcontrolRequest+permissionModesbazel test //crates/loopal-acp/...+ clippy + rustfmt all green