Skip to content

feat(core): allow orchestrator permissions to be configurable via config#2126

Open
aryanc403 wants to merge 1 commit into
AgentWrapper:mainfrom
aryanc403:aryanc/setup-orchestrator-permissions
Open

feat(core): allow orchestrator permissions to be configurable via config#2126
aryanc403 wants to merge 1 commit into
AgentWrapper:mainfrom
aryanc403:aryanc/setup-orchestrator-permissions

Conversation

@aryanc403

Copy link
Copy Markdown

Problem

Orchestrator sessions had hardcoded permissions: "permissionless" across three code paths (spawn, restore, and resume). This was not configurable and prevented users from enabling permission prompts for orchestrator agents.

Solution

  • Extract orchestrator permissions from selection.permissions (which respects the config) instead of hardcoding to "permissionless"
  • Preserve backward compatibility by falling back to "permissionless" if orchestrator.agentConfig.permissions is not explicitly configured
  • Applied consistently across all three orchestrator launch paths:
    1. Fresh orchestrator spawn (_spawnOrchestratorInner)
    2. Orchestrator restore via projectConfigForLaunch
    3. Orchestrator resume via agentLaunchConfig permissions field

Config Usage

Users can now configure orchestrator permissions in agent-orchestrator.yaml:

orchestrator:
agentConfig:
permissions: default # or "auto-edit", "suggest", etc.

If not specified, defaults to "permissionless" (original behavior).

Testing Plan

  1. Config loading verification:

    • Load a config with orchestrator.agentConfig.permissions: default
    • Verify loadConfig() returns the correct permissions
    • Verify loadConfig() falls back to "permissionless" when not configured
  2. Fresh orchestrator spawn:

    • Run ao start with orchestrator permissions set to "default"
    • Verify the launch command does NOT contain --dangerously-skip-permissions
    • Run ao start without orchestrator config
    • Verify fallback to "permissionless" (flag IS present)
  3. Orchestrator resume/restore:

    • Kill and restore an existing orchestrator session with default permissions
    • Verify it launches with correct permissions (no flag for "default")
    • Test with different permission modes: permissionless, default, auto-edit, suggest
  4. Backward compatibility:

    • Existing configs without orchestrator.agentConfig.permissions must still work
    • Verify they get "permissionless" by default (original behavior preserved)
  5. Integration tests:

    • Run: pnpm test:integration
    • Verify no regressions in session spawn/restore logic

## Problem
Orchestrator sessions had hardcoded `permissions: "permissionless"` across
three code paths (spawn, restore, and resume). This was not configurable and
prevented users from enabling permission prompts for orchestrator agents.

## Solution
- Extract orchestrator permissions from `selection.permissions` (which respects
  the config) instead of hardcoding to "permissionless"
- Preserve backward compatibility by falling back to "permissionless" if
  `orchestrator.agentConfig.permissions` is not explicitly configured
- Applied consistently across all three orchestrator launch paths:
  1. Fresh orchestrator spawn (_spawnOrchestratorInner)
  2. Orchestrator restore via projectConfigForLaunch
  3. Orchestrator resume via agentLaunchConfig permissions field

## Config Usage
Users can now configure orchestrator permissions in agent-orchestrator.yaml:

  orchestrator:
    agentConfig:
      permissions: default        # or "auto-edit", "suggest", etc.

If not specified, defaults to "permissionless" (original behavior).

## Testing Plan

1. **Config loading verification:**
   - Load a config with `orchestrator.agentConfig.permissions: default`
   - Verify loadConfig() returns the correct permissions
   - Verify loadConfig() falls back to "permissionless" when not configured

2. **Fresh orchestrator spawn:**
   - Run `ao start` with orchestrator permissions set to "default"
   - Verify the launch command does NOT contain `--dangerously-skip-permissions`
   - Run `ao start` without orchestrator config
   - Verify fallback to "permissionless" (flag IS present)

3. **Orchestrator resume/restore:**
   - Kill and restore an existing orchestrator session with default permissions
   - Verify it launches with correct permissions (no flag for "default")
   - Test with different permission modes: permissionless, default, auto-edit, suggest

4. **Backward compatibility:**
   - Existing configs without orchestrator.agentConfig.permissions must still work
   - Verify they get "permissionless" by default (original behavior preserved)

5. **Integration tests:**
   - Run: `pnpm test:integration`
   - Verify no regressions in session spawn/restore logic

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
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