Skip to content

fix(acp): round-trip permission_mode + derive permissionModes from VARIANTS#198

Merged
yishuiliunian merged 1 commit into
mainfrom
fix/acp-permission-mode-roundtrip
Jun 12, 2026
Merged

fix(acp): round-trip permission_mode + derive permissionModes from VARIANTS#198
yishuiliunian merged 1 commit into
mainfrom
fix/acp-permission-mode-roundtrip

Conversation

@yishuiliunian

Copy link
Copy Markdown
Contributor

Problem

AgentsMesh's permission selector showed "—" (unknown) for loopal pods until a
manual switch — loopal's current/initial permission_mode never reached the frontend.
Root cause: translate/panel.rs dropped PermissionModeChanged (fell through
_ => None), unlike ModelChanged/ThinkingChanged which emit _loopal/model/_loopal/thinking.

Fix

  • panel.rs: add PermissionModeChanged arm → emit _loopal/permission_mode.
    loopal runtime already emits this on cold-start (cold_start_emit.rs) + switch
    (input_control_config.rs), so cold-start now seeds the selector's current mode.
  • permission.rs: derive strum::VariantNames (serialize_all snake_case);
    lifecycle.rs advertises permissionModes from PermissionMode::VARIANTS
    instead of a hardcoded array — the enum is now the single source of truth.

AgentsMesh side (separate change)

runner handler.go maps _loopal/permission_mode → OnConfigChange → configChanged
acpSession.configuration.permissionMode, so the selector renders the current mode.

Test

bazel test //crates/loopal-acp/... //crates/loopal-tool-api/... + clippy + rustfmt green.

panel.rs translate dropped PermissionModeChanged (fell through _ => None), so AgentsMesh's permission selector showed '—' until a manual switch. Add the arm mirroring ModelChanged/ThinkingChanged → emit _loopal/permission_mode; loopal runtime already emits PermissionModeChanged on cold-start + switch.

Also derive the permissionModes capability list from PermissionMode::VARIANTS (strum::VariantNames) instead of a hardcoded array, making the enum the single source of truth.
@yishuiliunian yishuiliunian merged commit 844e908 into main Jun 12, 2026
4 checks passed
@yishuiliunian yishuiliunian deleted the fix/acp-permission-mode-roundtrip branch June 12, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant