Skip to content

Sub-agent compact mode "Allow always" permission not persisting #3067

@yiliang114

Description

@yiliang114

What happened?

When using Qwen Code's sub-agent feature, the permission confirmation dialog uses compact mode UI with only three options:

  • "Yes, allow once"
  • "Allow always"
  • "No"

Selecting "Allow always" does not persist the permission. The next tool invocation still prompts for confirmation, requiring the user to select again.

Root cause analysis

Compact mode's "Allow always" button (ToolConfirmationMessage.tsx line 124) maps to ToolConfirmationOutcome.ProceedAlways.

However, persistPermissionOutcome() (packages/core/src/core/permission-helpers.ts) only handles ProceedAlwaysProject and ProceedAlwaysUser, completely ignoring ProceedAlways:

// Problematic code (line 176-181)
if (
  outcome !== ToolConfirmationOutcome.ProceedAlwaysProject &&
  outcome !== ToolConfirmationOutcome.ProceedAlwaysUser
) {
  return;  // ProceedAlways returns here, permission not saved
}

This causes compact mode's "Allow always" selection to:

  • Not write to settings.json
  • Not update in-memory PermissionManager
  • Still require confirmation on subsequent tool calls

What did you expect to happen?

After selecting "Allow always", the permission should be persisted. Subsequent tool invocations should be auto-approved without prompting again.

Reproduction steps

  1. Start a sub-agent task (e.g., ask agent to search code)
  2. When sub-agent needs to execute a shell command, compact mode confirmation appears
  3. Select "Allow always"
  4. When sub-agent executes the same command again, the prompt reappears

Client information

  • OS: macOS / Linux / Windows (all platforms)
  • Qwen Code version: v0.14.x+

Fix

PR coming: treating ProceedAlways as project scope in persistPermissionOutcome().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions