Skip to content

feat(cli): Allow SEATBELT profiles in user settings directory#26

Open
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-554-seatbelt-user-profiles
Open

feat(cli): Allow SEATBELT profiles in user settings directory#26
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-554-seatbelt-user-profiles

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Description:

This PR enhances the SEATBELT profile resolution logic to support both project-local and global user profiles. Specifically, the resolver now:

  • First checks for profile files in the project’s .qwen/ directory.
  • If not found, falls back to the user’s global .qwen/ directory (~/.qwen/ by default).

This change enables users to define and reuse global SEATBELT sandbox profiles across multiple projects — eliminating the need to duplicate profile files in every project directory.

Background:

Currently, SEATBELT supports the following predefined profiles:

  • permissive-closed
  • permissive-open
  • permissive-proxied
  • restrictive-closed
  • restrictive-proxied

As documented in docs/sandbox.md, users may also define custom profiles via the SEATBELT_PROFILE environment variable. However, the system previously only looked for custom profile files (e.g., sandbox-macos-<profile>.sb) within <project>/.qwen/name.sb. If the file was absent, resolution would fail — even if a valid profile existed in the user’s global settings directory.

Impact:

With this change, users can now place commonly used sandbox profiles in their global ~/.qwen/ directory and reference them from any project — streamlining setup and reducing redundancy.

Reviewer Test Plan

This only applies to macOS (because Seatbelt).

  • Write a seatbelt profile in your ~/.qwen. You may copy and modify one e.g. packages/cli/src/utils/sandbox-macos-permissive-open.sb into ~/.qwen/sandbox-macos-custom.sb,
  • Launch qwen with SEATBELT_PROFILE=custom qwen -s,
  • It should now show macOS Seatbelt (custom) in the status.

Fixes QwenLM#559

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@BingqingLyu BingqingLyu added conflicting-pr conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs and removed conflicting-group-1 labels May 7, 2026
@BingqingLyu

BingqingLyu commented May 7, 2026

Copy link
Copy Markdown
Owner Author

Conflict Group 1

This PR shares modified functions with 8 other PR(s): #10, #112, #113, #114, #117, #7, #88, #94.

These PRs should be reviewed as a batch — merging one may affect the others.

Function File Also modified by
start_sandbox sandbox.ts #10, #112, #113, #114, #117, #7, #88, #94
graph LR
    PR26["PR #26"]
    Fstart_sandbox_9815["start_sandbox<br>sandbox.ts"]
    PR26 -->|modifies| Fstart_sandbox_9815
    PR10["PR #10"]
    PR10 -->|modifies| Fstart_sandbox_9815
    PR112["PR #112"]
    PR112 -->|modifies| Fstart_sandbox_9815
    PR113["PR #113"]
    PR113 -->|modifies| Fstart_sandbox_9815
    PR114["PR #114"]
    PR114 -->|modifies| Fstart_sandbox_9815
    PR117["PR #117"]
    PR117 -->|modifies| Fstart_sandbox_9815
    PR7["PR #7"]
    PR7 -->|modifies| Fstart_sandbox_9815
    PR88["PR #88"]
    PR88 -->|modifies| Fstart_sandbox_9815
    PR94["PR #94"]
    PR94 -->|modifies| Fstart_sandbox_9815
Loading

Posted by codegraph-ai conflict detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicting-group-1 Conflicting PR group 1 — review as a batch conflicting-pr Shares at least one cross-PR dependency with other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom seatbelt profiles are only looked after in project/.qwen

2 participants