Enable Open Code skip-permissions env var in built-in templates #2935
Service Desk opened 2 days ago

Summary

Add OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true to built-in Open Code shell and container templates by default so sub-agents inherit skip-permissions.

Background

Raised from issue #2934. Open Code workspace templates already run tasks as:

opencode run --dangerously-skip-permissions "$TASK_PROMPT"

The CLI flag does not carry to sub-agents; the env var does. Workspace specs already support Environment Variables, so setting OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true manually works today.

Scope (agreed)

Templates only — no Task Automation checkbox / Open Code-specific UI option.

  1. Add OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true to built-in Open Code shell and container templates by default
  2. Rely on Environment Variables for any non-template / existing-spec cases (already sufficient)

Acceptance criteria

  1. New specs created from Open Code shell/container templates have OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true enabled by default
  2. No new Task Automation checkbox or Open Code-specific UI control

Workaround for existing specs

Manually add OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true under Environment Variables on the workspace spec.

  • Robin Shen commented 12 hours ago

    @servicedesk why we need to add opencode specific option in task automation setting if environment is sufficient in this case?

  • Service Desk commented 12 hours ago

    @robin Good point — Environment Variables are already sufficient functionally. Setting OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true on the workspace spec applies to the whole process tree (including sub-agents). The dedicated checkbox was proposed mainly for discoverability: users following the template / --dangerously-skip-permissions pattern may not realize the CLI flag does not carry to sub-agents, and the original request in issue #2934 asked for a contextual control with that hint.

    If you prefer not to add an Open Code-specific Task Automation option, we can drop that part. Possible reduced scopes:

    1. Close this issue — rely on Environment Variables only (workaround already works today)
    2. Templates only — add OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true to built-in Open Code shell/container templates by default (matches existing --dangerously-skip-permissions intent for sub-agents), but no new checkbox
    3. Keep as specified — checkbox + template defaults as in the acceptance criteria

    My recommendation is (2) unless you want zero Open Code-specific productization here. Which do you prefer?

  • Robin Shen commented 12 hours ago

    Option 2

  • Service Desk commented 12 hours ago

    @robin Acknowledged — proceeding with option 2 (templates only).

    Reduced scope for this issue:

    1. Add OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true to built-in Open Code shell and container templates by default
    2. No Task Automation checkbox / Open Code-specific UI option

    I do not have permission to write code in this project (tod issue checkout --for-write returned HTTP 403), so I cannot implement the template change myself. Please take the implementation from here, or grant write access if you want me to do it.

  • Robin Shen commented 12 hours ago

    Modify issue description to reflect this

  • Service Desk changed title 12 hours ago
    Previous Value Current Value
    Add Task Automation checkbox for Open Code skip-permissions env var
    Enable Open Code skip-permissions env var in built-in templates
  • Service Desk commented 12 hours ago

    @robin Updated the issue title and description to reflect option 2: templates only, no Task Automation checkbox.

  • Robin Shen changed fields 12 hours ago
    Name Previous Value Current Value
    Assignee
    robin
    wh
  • Work Horse commented 12 hours ago

    Implemented templates-only change: built-in Open Code shell and container templates now set OPENCODE_DANGEROUSLY_SKIP_PERMISSIONS=true by default so sub-agents inherit skip-permissions. No Task Automation checkbox or Open Code-specific UI was added.

    Please review pr #105.

  • Zak Siddiqui commented 11 hours ago

    Happy with all this @robin

    Thank you.

1/1
Type
New Feature
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-2935
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover